skip to Main Content

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?

2

Answers


  1. Chosen as BEST ANSWER

    When rebuilding, I had this mistake:

    ERROR:C:UsersutilisateurDesktopAPPLICATIONS MOBILESBLOC C - INTERFACESpersonnagesappbuildintermediatespackaged_manifestsdebugAndroidManifest.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...


  2. I Just Copy Your Code And It’s Working Fine

    Show Here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search