在Android中,写了一个switch demo,在华为6p上运行无效(现象:不能拖动,也不能点击),系统为Android 6.0,以下是xml文件中switch的定义:
<Switch android:id="@+id/switcher" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textOff="横向排列" android:textOn="纵向排列" android:thumb="@drawable/check" android:checked="true"/>
然后换模拟器运行,Android 4.4,顺利运行,能拖动,也能点击,均能实现switch的功能;上述在6p上运行,出现的问题,我猜应该是系统原因,具体没有深究。