Border texture for a View
Is there any way to set border texture for LinearLayout
or any other View
? I can't just set an image as the background because of different screen sizes.
Here is the sample of the texture I'm talking about:
I tried to use Nine-patch, but it stretches the white lines that are suppos开发者_如何学编程ed to be repeated.
Screenshot from Draw 9-patch tool:
You can use shape
drawable like this:
<shape android:shape="rectangle">
<solid android:color="#FAFAD2" />
<stroke android:width="1sp" android:color="#000000"
android:dashWidth="7sp" android:dashGap="5sp" />
</shape>
and this will result you something like this:
You can change color, width, border etc according to your requirements.
精彩评论