####下划线的实现
一条横线横穿文字左右的效果:
dashGap="0dp" 大于0 的时候是虚线
1. 样式:
> <?xml version="1.0" encoding="utf-8"?>
> <shape xmlns:android="http://schemas.android.com/apk/res/android"
> android:shape="line">
> <stroke
> android:width="1dp"
> android:color="@color/corner_gray_bg"
> android:dashGap="0dp"
> android:dashWidth="6dp"/>
> <!-- 虚线的高度 -->
> <size android:height="1dp"/>
> </shape>
2. 代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dis13"
android:layout_marginLeft="@dimen/guard_left_margin"
android:layout_marginRight="@dimen/guard_left_margin"
android:layout_marginTop="@dimen/dis15"
android:background="@drawable/bg_select_title"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:text="选择广告位置"
android:textColor="@color/text_light_color"
android:textSize="@dimen/font13" />
</LinearLayout>
一条横线横穿文字左右的效果:
dashGap="0dp" 大于0 的时候是虚线
1. 样式:
> <?xml version="1.0" encoding="utf-8"?>
> <shape xmlns:android="http://schemas.android.com/apk/res/android"
> android:shape="line">
> <stroke
> android:width="1dp"
> android:color="@color/corner_gray_bg"
> android:dashGap="0dp"
> android:dashWidth="6dp"/>
> <!-- 虚线的高度 -->
> <size android:height="1dp"/>
> </shape>
2. 代码:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/dis13"
android:layout_marginLeft="@dimen/guard_left_margin"
android:layout_marginRight="@dimen/guard_left_margin"
android:layout_marginTop="@dimen/dis15"
android:background="@drawable/bg_select_title"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center"
android:text="选择广告位置"
android:textColor="@color/text_light_color"
android:textSize="@dimen/font13" />
</LinearLayout>