扫码关注官方订阅号
该布局如图所示,或者不绘制分割线,只要能突出TextView就行!
业精于勤,荒于嬉;行成于思,毁于随。
1.给加个背景色
2.添加分割线
'<ImageView
android:layout_width="match_parent" android:layout_height="1dp" android:background="@android:color/darker_gray" />
`3.增加视图高度在控件中加入 android:elevation="5dp"可以自定义
1.绘制分割线
在TextView之间放个view就可以了,高度、颜色自己设置,设成灰色较好。 <TextView/> <View android:layout_width="match_parent" android:layout_height="0.5dp" android:background="@android:color/black"/> <TextView/>
2.突出TextView也简单,设置TextView的背景色(background)与LinearLayout的背景色(background) 例如:TextView背景为白色,LinearLayout背景色为灰色。
我们一般就是用view画线的宽度给个0.5dp即可
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:background="#eeeeee" android:layout_height="match_parent"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="创建的社团" android:textSize="16sp" android:paddingTop="20dp" android:paddingBottom="20dp" android:paddingLeft="30dp" android:background="@android:color/white" android:layout_marginTop="10dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="加入的社团" android:textSize="16sp" android:paddingTop="20dp" android:paddingBottom="20dp" android:paddingLeft="30dp" android:background="@android:color/white" android:layout_marginTop="10dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="消息" android:textSize="16sp" android:paddingTop="20dp" android:paddingBottom="20dp" android:paddingLeft="30dp" android:background="@android:color/white" android:layout_marginTop="10dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="设置" android:textSize="16sp" android:paddingTop="20dp" android:paddingBottom="20dp" android:paddingLeft="30dp" android:background="@android:color/white" android:layout_marginTop="10dp"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="退出登录" android:textSize="16sp" android:paddingTop="20dp" android:paddingBottom="20dp" android:paddingLeft="30dp" android:background="@android:color/white" android:layout_marginTop="10dp"/> </LinearLayout>
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
1.给加个背景色
2.添加分割线
'
<ImageView
`
3.增加视图高度
在控件中加入
android:elevation="5dp"
可以自定义
1.绘制分割线
2.突出TextView也简单,设置TextView的背景色(background)与LinearLayout的背景色(background)
例如:TextView背景为白色,LinearLayout背景色为灰色。
我们一般就是用view画线的宽度给个0.5dp即可