Widget.Material.Light.TextView.ListSeparator在哪里定义? [英] Where is Widget.Material.Light.TextView.ListSeparator defined?
问题描述
我正在阅读Big Nerd Ranch Guide撰写的《 Android编程》(第二版)一书.页面152包含标记:
I'm working through the book 'Android Programming' (2nd Edition) by the Big Nerd Ranch Guide. Page 152 contains the markup:
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/crime_title_label"
style="?android:listSeparatorTextViewStyle"
/>
在Android Studio中,当我在光标位于"listSeparatorTextViewStyle"上时单击F1时,它会显示文档.本文档的前三行是:
In Android Studio, when I click F1 while the cursor is on 'listSeparatorTextViewStyle' it brings up documentation. The first three lines of this documentation are:
android:listSeparatorTextViewStyle
TextView style for list separators.
?android:attr/listSeparatorTextViewStyle => @style/Widget.Material.Light.TextView.ListSeparator
Now when I search for the style Widget.Material.Light.TextView.ListSeparator on the page https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/styles.xml I get no result. Where is the style Widget.Material.Light.TextView.ListSeparator defined?
推荐答案
It's in the styles_material.xml (found here).
<style name="Widget.Material.TextView.ListSeparator" parent="Widget.TextView.ListSeparator">
<item name="background">@drawable/list_section_divider_material</item>
<item name="textAllCaps">true</item>
</style>
<style name="Widget.Material.Light.TextView.ListSeparator" parent="Widget.Material.TextView.ListSeparator"/>
Widget.TextView.ListSeparater是父级,可以在常规的styles.xml中找到:
Widget.TextView.ListSeparater is the parent and can be found in the regular styles.xml:
<style name="Widget.TextView.ListSeparator">
<item name="background">@drawable/dark_header_dither</item>
<item name="layout_width">match_parent</item>
<item name="layout_height">wrap_content</item>
<item name="textStyle">bold</item>
<item name="textColor">?textColorSecondary</item>
<item name="textSize">14sp</item>
<item name="gravity">center_vertical</item>
<item name="paddingStart">8dip</item>
</style>
这篇关于Widget.Material.Light.TextView.ListSeparator在哪里定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!