我正在寻找如何在显示选择的上下文操作栏时突出显示列表中的选定项目,我找到的解决方案是将android:background行布局xml 的属性设置为"?android:attr/activatedBackgroundIndicator".
如何设置这个工作呢?
我正在尝试通过布局构建Android UI.我从以下开始:
<TextView
android:id="@+id/..."
android:layout_marginTop="8dip"
android:text="..."
style="?android:attr/listSeparatorTextViewStyle"/>
Run Code Online (Sandbox Code Playgroud)
这看起来不错(所有大写字母,较小的字体,下面的分隔栏).现在我想扩展样式,所以我将其更改为以下内容:
<TextView
android:id="@+id/..."
android:layout_marginTop="8dip"
android:text="..."
style="@style/section_title"/>
Run Code Online (Sandbox Code Playgroud)
具有以下风格:
<style name="section_title" parent="@android:attr/listSeparatorTextViewStyle">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
Run Code Online (Sandbox Code Playgroud)
这不起作用(字体是正确的,但分隔线已经消失).
怎么样......那?
android ×2