Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/231.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在复选框上设置附加文本请参见图片_Android - Fatal编程技术网

Android 如何在复选框上设置附加文本请参见图片

Android 如何在复选框上设置附加文本请参见图片,android,Android,如何在复选框上添加另一个文本请参见红色圆圈内的内容。 见下文。 请帮忙 我认为显示的图片来自复选框偏好, 您可以学习本教程 如果您不想使用首选项,您可以自定义它只需在复选框旁边放置一个带有两个文本视图的线性布局即可。下面的代码应该可以实现您想要的 <LinearLayout android:layout_width="fill_parent" android:layout_hei

如何在复选框上添加另一个文本请参见红色圆圈内的内容。 见下文。 请帮忙


我认为显示的图片来自复选框偏好, 您可以学习本教程


如果您不想使用首选项,您可以自定义它

只需在复选框旁边放置一个带有两个文本视图的线性布局即可。下面的代码应该可以实现您想要的

                <LinearLayout
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dip"
                    android:orientation="horizontal" >  

                   <CheckBox
                        android:id="@+id/cb_MyCheckBox"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"/>

                    <LinearLayout
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:layout_gravity="center" >

                            <TextView
                                android:id="@+id/tv_TopText"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="Top Text "
                                android:textColor="#000000"
                                android:textSize="10dp" >
                            </TextView>

                            <TextView
                                android:id="@+id/tv_BottomText"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="BottomText "
                                android:textColor="#000000"
                                android:textSize="10dp" >
                            </TextView>                             
                        </TextView>
                </LinearLayout>
                </LinearLayout>


您需要进行相应的调整以获得所需的外观。

看起来您是从“首选项”活动中获得的。如果您不想要首选项活动,可以使用自定义的listview。

必须单击上下箭头下方的复选框。