I am using a RelativeLayout on the screen. I have RadioButtons docked to the right side of the screen and I want to align the TextViews to the left of the RadioButtons.
So here is an example of my text view:
<TextView
android:id="@+id/editText2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/radioButton1"
android:gravity="right"
android:hint="@string/error1" />
I am not sure if it aligns them to the center of the RadioButton and not below because that doesn’t work for me. I hate Eclipse’s (adt) xml gui, and editing in xml file because I don’t get what I want. Is there an easier gui, xml editor?
Well there is no better xml gui editor for android for now. IntelliJ Idea 10.5 doesnot even have screen preview only xml editor.
Now the trick to use the screen gui editor and xml editor. You start with basic gui editing by screen editor that comes with ADT and then to fine tune either use properties or raw xml editor.
As per what you want for above problem. Here is the soln:
For creating this i didnot edit the xml file myself. I just used the gui screen editor that comes with ADT. Here are the steps
RadioButtonfrom left pane and dragged it towards the right edge of the screen till i can see two green anchor points appear and in the yellow info appeared stating the properties for alignment.TextViewand drag towards the left till I see green anchor points.TextViewtowards theRadioButtontill I see green anchor and the correctlayout_toLeftOfproperty in the yellow info box.