2016-08-10 6 views
1

enter image description hereNexus 5バージョン6.0.1でスイッチの表示が異なるのはなぜですか?

出力は、これは、スイッチのための私のコードでのみオン/オフ

を切り替えるの..showsが表示されない...今、上のようなものです...

他のすべてのデバイス出力されますいいですが、Nexus 5のは、スイッチ/トグルだけでオン/オフを表示します。

<LinearLayout 
        android:layout_width="0dp" 
        android:layout_height="match_parent" 
        android:layout_weight="0.7" 
        android:orientation="horizontal"> 

        <TextView 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:layout_marginLeft="5dp" 
         android:text="Save recorded call? " 
         android:textColor="@color/black" 
         android:textStyle="bold" /> 

        <Switch 
         android:id="@+id/recSwitch" 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:textOff="Off" 
         android:textOn="On" /> 
       </LinearLayout> 

の提案が受け入れ..助けを事前にありがとう...

+0

を追加します([switchCompat]を使用スイッチの代わりにhttps://developer.android.com/reference/android/support/v7/widget/SwitchCompat.html) – SaravInfern

答えて

1

はあなたの依存関係に

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.0.3' 
} 
あなたのXMLで

<LinearLayout 
       android:layout_width="0dp" 
       android:layout_height="match_parent" 
       android:layout_weight="0.7" 
       android:orientation="horizontal"> 

       <TextView 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="5dp" 
        android:text="Save recorded call? " 
        android:textColor="@color/black" 
        android:textStyle="bold" /> 

       <android.support.v7.widget.SwitchCompat 
        android:id="@+id/switch_compat2" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Switch Compat" 
        app:showText="false"/> 
      </LinearLayout> 
関連する問題