2014-11-20 1 views
0

textoff와 같은 리소스를 어떻게 설정합니까? android-switch-backport - 어떻게 리소스를 설정합니까?

나는 예 android-switch-backport-master/sample 시작 그래서 같은 고해상도/레이아웃/main.xml에 수정 :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:switch="http://schemas.android.com/apk/res/org.jraf.android.backport.switchwidget.sample" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    tools:context=".MainActivity" > 

    <org.jraf.android.backport.switchwidget.Switch 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:textOff="test" 
     switch:asb_switchTextOff="@string/foo" 
     /> 

</LinearLayout> 

xmlns:switch="http://schemas.android.com/apk/res/org.jraf.android.backport.switchwidget.sample" switch:asb_switchTextOff="@string/foo"의 추가를. (@ string/foo는 다른 곳에서 정의됩니다).

그러나 컴파일러가 행복해 보이지만 스위치의 "꺼짐"상태는 여전히 "꺼짐"으로 표시됩니다. 내가해야 할 일이 있니?

+0

이 백 포트를 완전히 잊어 버리고 v7 호환성 라이브러리를 사용해야합니까? –

답변

0

좋아요, 알아 냈습니다. 동일한 질문이있는 다른 사람들을 위해 여기에 게시 :

리소스는 이 아니라 asb_textOff입니다. 후자는 switchpreferences를위한 것입니다.

<org.jraf.android.backport.switchwidget.Switch 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:textOff="test" 
    switch:asb_textOff="@string/foo" 
    /> 
관련 문제