簡體   English   中英

向Android SwitchCompat小部件添加描述

[英]Adding a description to android SwitchCompat widget

我想為我的SwitchCompat小部件設置一個描述。 有人知道嗎?

“ android:text”是開頭文本,但我想設置一個描述或“摘要”。 (我的英語不太好)

我的代碼:

<android.support.v7.widget.SwitchCompat
                android:id="@+id/my_switch"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/switch_title"
                android:button="@null"
                android:padding="20dp"/>

似乎您必須在與SwitchCompat相同的布局中添加TextView,例如https://github.com/Grarak/KernelAdiutor/blob/master/app/src/main/res/layout/switchcompat_cardview.xml

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM