自定义背景的按钮显示半文本隐藏的android

时间:2015-04-13 07:21:57

标签: android button background

我正在使用自定义背景btn_selector.xml

的按钮

按钮上的文字从device的底部隐藏了一半,但在emulator

上看起来很完美

仅在Dialog Themed Acticvity

上发生这种情况

我不知道是什么导致这个问题发生

btn_shape_normal.xml

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle" >

    <!-- this is to give gradient effect -->
    <gradient
        android:angle="270"
        android:endColor="#1A82BF"
        android:startColor="#1A82BF" />
    <!-- this is make corners of button rounded -->
    <corners
        android:bottomLeftRadius="5dip"
        android:bottomRightRadius="5dip"
        android:topLeftRadius="5dip"
        android:topRightRadius="5dip" />

</shape>

activity.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"         
    android:orientation="vertical"

    android:background="#FFFFFF" >

    <RelativeLayout android:id="@+id/rel_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="10dp">



      <ImageView
        android:id="@+id/img_close"
        android:layout_width="20dp"
        android:layout_height="20dp"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:src="@drawable/close" />       


      <TextView android:id="@+id/txtvw_1"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textSize="15sp"
          android:typeface="normal"
          android:padding="5dp"
          android:textColor="@color/Black"
          android:text="You will not be able to see the prices in the list.\nPlease login to see the prices."
          android:layout_below="@+id/img_close"/>



        <Button
                android:id="@+id/btn_Continue"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:background="@drawable/btn_selector"
                android:text="Continue"
                android:textColor="@color/White"
                android:textStyle="bold" 
                android:padding="5dp"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:layout_marginBottom="5dp"
                android:visibility="visible"
                android:layout_below="@+id/txtvw_1"
                />

        <Button
                android:id="@+id/btn_Login_Signup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:background="@drawable/btn_selector"
                android:text="Login/Signup"
                android:textColor="@color/White"
                android:textStyle="bold" 
                android:padding="5dp"
                android:layout_marginLeft="20dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:visibility="visible"
                android:layout_below="@+id/btn_Continue"/>



        </RelativeLayout>



</LinearLayout>

0 个答案:

没有答案