右上标的实现

回家休息了20多天 嘿嘿今天看见别人做了一个右上角图标的东西,感觉不错 本以为是用.9.png格式实现的原来不是

仔细看了一下原来如下:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
 
        <Button android:id="@+id/discounts_button"
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
               
                android:text="我要进行测试"
                android:textColor="#FFFFFF"
                android:textSize="20sp"
               
                android:layout_marginTop="40dp"
                android:layout_marginLeft="20dp"/>
 
        <RelativeLayout android:layout_width="wrap_content" 
                android:layout_height="wrap_content"
                android:layout_gravity="top|left">
 
            <ImageView android:layout_width="wrap_content" 
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:src="@drawable/a1"
                    android:layout_centerInParent="true"/>
 
             <TextView android:layout_width="wrap_content" 
                           android:layout_height="wrap_content"
                           android:textStyle="bold"
                           android:text="20"
                           android:layout_centerInParent="true" />
         </RelativeLayout>
</FrameLayout>

你可能感兴趣的:(android)