答案 0 :(得分:0)
您应该使用九个补丁图像来执行此操作。
https://developer.android.com/studio/write/draw9patch.html
示例工具:
https://romannurik.github.io/AndroidAssetStudio/nine-patches.html#&sourceDensity=320&name=example
九个补丁是一个png图像,边框中有黑色像素,用于划分必须扩展的区域。格式为example.9.png
,.9.png
是扩展名。
一个小教程,你可以找到其他人: https://www.youtube.com/watch?v=wLimJf-EIl8