Android installation: background messed up the text for my radio

I built it for Android 2.2

Here is my code. Java is generated by eclipse. Changed xml.

package foo.bar.radiobuttontest; import android.app.Activity; import android.os.Bundle; import foo.bar.radiobuttontest.R; public class rbt extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } 

here is my res / layout / main.xml

 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RadioGroup android:id="@+id/orientation" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5px"> <RadioButton android:id="@+id/horizontal" android:background="#aa0000" android:text="horizontal" /> <RadioButton android:id="@+id/vertical" android:text="vertical" /> </RadioGroup> </LinearLayout> 

While experimenting with the drums, I started creating a very simple application. It looks like this:

* horizontal * vertical

Not without reason, I thought that I changed the background color. I started by changing the background of the RadioGroup element, everything worked as expected. Then just for fun, although I would change the background of only one of the switches in the group. This can be seen in main.xml above. After that, I noticed that the text of the radio object is now covered with a radio block, the page now looks something like this:

* horizontal * vertical

Except that you can still see “ho” horizontally, they are simply covered by a radio block

Is this the expected behavior?

+4
source share
1 answer

I searched a bit and I found that the proposed @kcoppock was right. Here you will find the radio button style, and this is a reference background image:

alt text

These are nine patches whose content area excludes the radio area. I think you could start with this image to create your own background.

+5
source

All Articles