首页 > IT职业 > IT职场 > Android中的分割线
关于android的分割线的创建一共有三种方式
<View
android:layout_width=“match_parent"
android:layout_height=“1dp"
android:background=”#000000”/>
这种方式是最简单的创建方法,但封装度不好.不利于多次被复用.
<ImageView
android:layout_width=“match_parent"
android:layout_height=“0.5dp"
android:background=”@color/colorAccent”/>
这种方式使用的较多
<solid android:color="@color/colorAccent"/>
<size android:height="1dp"/>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2471/viewspace-2825976/ ,如需转载,请注明出处,否则将追究法律责任。