Thursday, July 25, 2013

Drawable Pattern

 src_one
src_two


pattern_checker.xml
-----------------------
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
    android:src="@drawable/src_one"
    android:tileMode="repeat">
    

</bitmap>
pattern_stripe.xml
---------------------
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android" 
     android:src="@drawable/src_two"
    android:tileMode="mirror">

</bitmap>


activity_main.xml
--------------------
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity"
    android:background="@drawable/pattern_stripe" >

</RelativeLayout>




No comments:

Post a Comment