I have a layout which have RadioGroup and radiobuttons. it works but there are problems in display. I've shared the screenshots below.
Android 4.2.1 - 4.65 inch

Tablet Android 2.2 - 7 inch

Android 4.1.2 - 5.5 inch

code from the bottorbar layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:padding="3dp" android:gravity="center"
android:background="@drawable/bottom"
>
<RadioGroup
android:id="@+id/radioTur"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:measureWithLargestChild="true"
android:layout_gravity="center_vertical"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/rad_anasayfa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:button="@null"
android:gravity="center"
android:drawableTop="@drawable/anasayfabutton"
android:textColor="@color/White"
android:onClick="Anasayfa_TIKLA"
android:text="Anasayfa" >
</RadioButton>
<RadioButton
android:id="@+id/rad_haber"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"
android:gravity="center"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableTop="@drawable/haberlerbutton"
android:textColor="@color/White"
android:onClick="Haber_TIKLA"
android:text="Haberler" >
</RadioButton>
<RadioButton
android:id="@+id/rad_duyuru"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"
android:gravity="center"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableTop="@drawable/duyurubutton"
android:textColor="@color/White"
android:onClick="Duyuru_TIKLA"
android:text="Duyurular" >
</RadioButton>
<RadioButton
android:id="@+id/rad_yemek"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"
android:gravity="center"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableTop="@drawable/yemekbutton"
android:textColor="@color/White"
android:onClick="Yemek_TIKLA"
android:text="Yemek" >
</RadioButton>
<RadioButton
android:id="@+id/rad_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:button="@null"
android:gravity="center"
android:layout_weight="1"
android:onClick="Arama_TIKLA"
android:textAppearance="?android:attr/textAppearanceSmall"
android:drawableTop="@drawable/search_icon"
android:textColor="@color/White"
android:text="Arama" >
</RadioButton>
</RadioGroup>
</LinearLayout>
code from main layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:id="@+id/AnaLayout"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/linearLayout1"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" >
<include
android:id="@+id/cell1"
android:layout_height="wrap_content"
layout="@layout/bottombar"
/>
</LinearLayout>
</RelativeLayout>
I have been working for a few days.I didn't understand problem. Can someone help me ?
my icon
I found problem. The Problem is android:button="@null".
If the RadioButton has the android:button="@null" property the result will be:

If the RadioButton doesn't have the android:button="@null" property the result will be:

If the RadioButton has the android:button="@null" and android:background="@android:color/transparent" properties the result will be:

I added the android:background="@android:color/transparent" property to all RadioButtons and the problem was resolved.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With