是否有一种方法可以在所有平台上使用类似于Android中的可伸缩图像(如9-patch)或iOS中的resizableImageWithCapInsets:edgeInsets?
是否有一种方法可以在所有平台上使用类似于Android中的可伸缩图像(如9-patch)或iOS中的resizableImageWithCapInsets:edgeInsets?
我曾经使用过一个付费的库http://forms9patch.com,它非常稳定。
你可以以跨平台的方式将任何图像转换为9patch格式:
var image2 = new Forms9Patch.Image () {
Source = ImageSource.FromResource("MyDemoApp.Resources.Images.redribbon.png"),
CapInsets = new Thickness(23, 0, 110, 0),
}
编辑:请注意,使用Forms9Patch.ImageSource不需要Forms9Patch许可证。 因此,您可以免费使用此库使用Forms9Patch.ImageSource。