很有启发的TextView和Divider

本文详细介绍了在界面设计中如何使用TextView和FrameLayout进行元素布局,并展示了如何通过XML代码为UI元素设置样式属性,如阴影效果、文字大小及颜色等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

                <TextView
                    android:id="@+id/user_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_toRightOf="@id/user_avatar"
                    android:layout_marginLeft="13dp"
                    android:singleLine="true"
                    android:ellipsize="end"
                    android:shadowColor="@android:color/black"
                    android:shadowDx="3.0"
                    android:shadowDy="3.0"
                    android:shadowRadius="5.0"
                    android:text="@string/user_name"
                    android:textSize="20sp"
                    android:textColor="@android:color/white" />

                <FrameLayout
                    android:id="@+id/user_divider_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@id/user_avatar"
                    android:layout_marginTop="4dp"
                    android:layout_marginLeft="21dp"
                    android:layout_marginRight="21dp">

                    <ImageView
                        android:layout_width="match_parent"
                        android:layout_height="1px"
                        android:layout_marginTop="5dp"
                        android:contentDescription="@null"
                        android:background="#DFDFDF" />

                    <ImageView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="29dp"
                        android:contentDescription="@null"
                        android:src="@drawable/arrow_up" />
                </FrameLayout>

















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值