Taking linearlayout as an example, the background attribute provided by linearlayout will stretch the background image, which is rather ugly. In fact, we only need to make a few modifications to achieve the effect of CSS background images in Web programming. Let's try it.
Create duplicate background images
Create a repeat_bg.xml file in the drawable directory:
<? XML version = "1.0" encoding = "UTF-8"?> <Bitmap xmlns: Android = "http://schemas.android.com/apk/res/android" Android: src = "@ drawable/BG" Android: tilemode = "repeat"/>
Then, you can reference the layout in the XML file as follows:
<Linearlayout Android: layout_width = "fill_parent" Android: layout_height = "fill_parent" Android: Background = "@ drawable/repeat_bg"> </linearlayout>
All rights reserved. If you need to reprint it, indicate the source. Thank you for your cooperation. Shenyang -- binzi.
Note: QQ technology exchange group: add one if you are interested in 108614806.