您的位置:首页 > 大数据 > 人工智能

自定义dailog注意事项

2016-01-26 20:48 465 查看
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/dailog_custom_shape"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="48dp"
android:gravity="left|center"
android:paddingLeft="15dp"
android:text="订单取消成功"
android:textColor="@color/my_addr_username_color"
android:textSize="18dp" />

<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:background="@color/title_bar_color" />

<TextView
android:layout_width="match_parent"
android:layout_height="70dp"
android:gravity="center_vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:text="在线支付的金额, 预计3 - 10个工作日内原路退还到原支付账户!"
android:textColor="@color/my_addr_username_color"
android:textSize="18dp" />

<TextView
android:id="@+id/textview_known_id"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="20dp"
android:layout_marginTop="20dp"
android:background="@drawable/tab_bg"
android:gravity="center"
android:padding="10dp"
android:text="知道了"
android:textColor="@android:color/white"
android:textSize="18dp" />
</LinearLayout>
注意:最后一个TextView的android:layout_width="wrap_content", 会使dailog宽度为最后一个控件的宽度,所以让最后一个控件的android:layout_width="match_parent"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: