Norway


I have to Split my width in Half and then I have to split my height into 3 sections: 25,25, and 50. I can not figure out the layout that will make my buttons only take up 25% height and 50% width. This is my current code. I need the radio group to the left and taking up 25% and then the button to the right taking up 25% . With them splitting the screen 50/50. Hopefully that makes sense. Here’s my current code:

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

<RadioGroup
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="25"
    >

    <RadioButton
        android:id="@+id/radio_one"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Nouns"/>


    <RadioButton
        android:id="@+id/radio_two"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Two"/>


    <RadioButton
        android:id="@+id/radio_three"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Three"/>

    <Button
        android:id="@+id/button3"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Button" />


</RadioGroup>


</LinearLayout>

UPDATE: I was able to make changes and I can now control the percentage of the screen that the radio group takes up. Now I’m having trouble getting the button beside it and restricting both the radiogroup and the button to split the screen 50/50.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here