05 January 2017

Android: Công nghệ 9 Path giữ điểm ảnh không vỡ

Download button_demo.png
Để tạo ảnh button_demo.9.png truy cập website 
Hoặc sử dụng 9 path trên Android Studio
View button không vỡ góc ảnh co dãn trong khoảng bôi đen
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimary"
    android:orientation="vertical"
    android:padding="12dp">

    <EditText
        android:id="@+id/etFirstName"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dp"
        android:hint="username"
        android:padding="15dp"
        android:background="#fff"
        android:textColor="#fff"
        android:textColorHint="#b6b1b1" />

    <EditText
        android:id="@+id/etSurname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:hint="password"
        android:padding="15dp"
        android:background="#fff"
        android:textColor="#fff"
        android:textColorHint="#b6b1b1" />

    <Button
        android:id="@+id/btCombine"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/button_demo"
        android:text="Login"
        android:textSize="18sp"
    />

    <Button
        android:id="@+id/tvResult"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:textSize="18dp"
        android:padding="10dp"
        android:layout_marginTop="10dp"
        android:background="@drawable/button_demo"
        android:text="Don't have a count ! Create new"
        android:textColor="#000" />

</LinearLayout>

0 nhận xét:

Post a Comment

 

BACK TO TOP

Xuống cuối trang