竖线:
<View android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:background="@color/edittext_hint"/>圆角:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 背景颜色 -->
<solid android:color="@color/layout_register_background" />
<padding android:left="5sp" />
<!-- 四个角为圆角 -->
<corners
android:bottomLeftRadius="5dp"
android:bottomRightRadius="5dp"
android:topLeftRadius="5dp"
android:topRightRadius="5dp" />
<!-- 边框 -->
<stroke
android:width="1dp"
android:color="@color/edittext_hint" />
</shape>然后引用的时候,在xml文件中android:background="@drawable/shape_corner"
本文深入解析了Android应用UI设计中使用竖线与圆角元素的作用与实现方式,通过XML代码实例展示如何创建并引用这些元素以提升界面美观性和功能性。重点介绍了竖线和圆角的配置属性及其在界面布局中的应用,帮助开发者掌握这一关键技能。
3614

被折叠的 条评论
为什么被折叠?



