Home > Mobile >  Android RadioButton button not appearing in editor
Android RadioButton button not appearing in editor

Time:02-15

Here is my activity_main.xml :

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@ id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@android:color/white">
    <include layout="@layout/toolbar"></include>

    <RadioGroup
        android:id="@ id/choixPersonnage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RadioButton
            android:id="@ id/boutonGuerrier"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/personnage1"
            android:textSize="20sp"/>

        <RadioButton
            android:id="@ id/boutonMage"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/personnage2"
            android:textSize="20sp"/>
    </RadioGroup>

</LinearLayout>

And here is what appears in my editor:

enter image description here

Both button texts work, but the RadioButton buttons just do not appear, nor do they take space. They are just not there...

In all the Radio Button problems I found, no one seemed to have the same problem I do. Anyone could help me out here with this basic thing?

CodePudding user response:

I Just Copy Your Code And It's Working Fine

Show Here

CodePudding user response:

When rebuilding, I had this mistake:

ERROR:C:\Users\utilisateur\Desktop\APPLICATIONS MOBILES\BLOC C - INTERFACES\personnages\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:11: AAPT: error: resource style/Theme.Personnages (aka uqac.dim.personnages:style/Theme.Personnages) not found.

So I just went in my manifest and erased the "Theme." before the "Personnages" and it worked.

Android Studio works in mysterious ways...

  • Related