一个Android屏幕有三种类型的瓷砖(three types of tiles for one Android screen)
我想使用三种重复的瓷砖作为一个Android屏幕的背景。 以下是我想要达到的最终结果。
可以在Android中完成吗?
I want to use three kinds of repeating tiles as background for one Android screen. The following is what I want to achieve as an end result.
Can it be done in Android?
最满意答案
在drawable文件夹中创建一个xml,并使用以下代码
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@drawable/YOUR_IMAGE android:antialias="true" android:dither="false" android:filter="false" android:gravity="fill" android:tileMode="repeat" />然后将此文件设置为您的背景。 :)
Creating three layouts inside the main layout achieves the design.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".SplashActivity" > <RelativeLayout android:layout_width="match_parent" android:layout_height="1dp" android:layout_weight="4" android:background="@drawable/woodentile" > </RelativeLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0sp" android:layout_weight="1" android:background="@drawable/woodenshadowtile" > </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="0sp" android:layout_weight="1" android:background="@drawable/papertile" > </LinearLayout> </LinearLayout>You need three bitmap files in the drawable folder. I will show woodentile.xml as an example.
<?xml version="1.0" encoding="utf-8"?> <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:dither="true" android:src="@drawable/inno_luck_wood_pattern_background" android:tileMode="repeat" > </bitmap>That's it. Doing this results in the kind of design that I want to create.
更多推荐
Android,want,屏幕,电脑培训,计算机培训,IT培训"/> <meta name="description&q
发布评论