交换机的问题 - 只有一个选项可见 [英] Switch issue - only one option visible

查看:187
本文介绍了交换机的问题 - 只有一个选项可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Android应用程序中使用的开关。我尝试过,但主要的问题是

I want to use switch in an android application. I tried it but main issue is


  • 如果我选择ON,则不会显示了文字。

  • 如果我选择了关闭,它不会在文本显示。

关文本,但我们可以通过点击开关的黑色区域选择OFF。

Off text is not displayed but we can select OFF by clicking in black area of switch.

code

<Switch android:id="@+id/mySwitch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="48dp"
android:layout_marginTop="26dp"
android:height="50dp"
android:text="ON OFF"
android:textSize="20sp"
android:switchMinWidth="50sp"
android:switchPadding="50sp"/>

在国家

关机状态

我怎么可以显示在同一时间两个文本?
我可以改变开关的文本两种状态ON / OFF?

How i can display both text at the same time? Can i change text of switch for both state ON/OFF?

任何帮助,将AP preciated。

Any Help would be appreciated.

先谢谢了。

推荐答案

通过这个链接进入。这是一个好的图书馆,你可以通过code,并找出如何通过自己或使用该库,因为它是。

Go through this link. It is a good library, you can go through the code and find out how by yourself or use the library as it is.

这篇关于交换机的问题 - 只有一个选项可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆