2016-08-17 15 views
2

アプリケーションが正常にデバイスで実行された後、ラジオボタンのテキストを編集したいと思います。私はこれを達成することはできますか?ラジオボタンのテキストを編集可能にすることはできますか?

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" > 

<RadioGroup 
    android:id="@+id/radioGroup1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginTop="10dp" 
    android:orientation="horizontal" 
    android:weightSum="2" > 

    <RadioButton 
     android:id="@+id/radio0" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="call" /> 

    <RadioButton 
     android:id="@+id/radio1" 
     android:layout_width="0dp" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:checked="true" 
     android:text="email" /> 
</RadioGroup> 

だから、最初は私のラジオボタンはコールとemail.So私はこれを実行したとき、私はそれが編集可能である必要が命名されます。

答えて

0

これを使用します。
- RadioButton rb =(RadioButton)findViewById(R.id.rbMyAvatars);

  • rb.setText( "dfjhdfssdf");
関連する問題