添加]部分分隔"我的布局? [英] Adding "section dividers" to my layout?
问题描述
借助 Android的设计 - 列出页面描述部分分隔。我知道,你可以使用 addHeaderView()
A 的ListView
有同样的效果。我想用一个节分没有的ListView
,而在的LinearLayout
。
The Android Design - Lists page describes "section dividers". I'm aware you can use addHeaderView()
a ListView
for a similar effect. I would like to use a "section divider" without a ListView
, but rather a LinearLayout
.
在下面的截图中,我指的是蓝色文字电话和电子邮件,它也有它下面的线。该截图是从 Android的设计 - 文本字段
In the screenshot below, I'm referring to the blue text "Phone" and "Email" which also has an line below it. The screenshot is from Android Design - Text Fields
我如何去将它添加到我的布局?它它只是一个TextView加一个水平线上?
How do I go about adding it to my layout? It it simply a TextView plus a horizontal line?
推荐答案
我一直在寻找同样的问题。 我发现了一个简单的方法来告诉应用程序,一个texview是一款分隔符:
I was looking for the same issue. I found an easy way to tell the app that a texview is a section separator:
<TextView
android:id="@+id/address_label"
style="?android:attr/listSeparatorTextViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Address"/>
该行:
style="?android:attr/listSeparatorTextViewStyle"
加下划线的文本和风采吧accordingli到defaulf分隔符的主题。
add the underline to the text and style it accordingli to the defaulf "Separator" theme.
这篇关于添加]部分分隔&QUOT;我的布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!