joevj
Newbie
Hi guys,
I have an issue with keeping things aligned in my layout. I have a nested LinearLayout & RelativeLayout.
my xml is below..
When I see this in Eclipse, it looks like "Layout in Eclipse.jpg" {attached} It had issues, but thought the alignment was better.
But When I see this Emulator (or my mobile), it looks like "Layout in Emulator.jpg" {attached}. Its much worse!
I want the radio button to be aligned with each text box. I tried to wrap it vertically and i thought it would get aligned automatically. It turned to be not that easy...
Can someone help me fix the issue...
thanks in advance
I have an issue with keeping things aligned in my layout. I have a nested LinearLayout & RelativeLayout.
my xml is below..
Code:
<?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">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="10">
<RadioGroup android:layout_width="wrap_content" android:orientation="vertical" android:layout_height="fill_parent">
<RadioButton android:id="@+id/radioAmount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:tag="Amount"/>
<RadioButton android:id="@+id/radioInt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:tag="Int"/>
<RadioButton android:id="@+id/radioTerm" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:tag="Term"/>
<RadioButton android:id="@+id/radioEMI" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="" android:tag="EMI"/>
</RadioGroup>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent">
<TextView android:id="@+id/labelAmount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/theAmount" />
<EditText android:id="@+id/entryAmount" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/labelAmount" android:inputType="numberDecimal" android:layout_marginBottom="10dip"/>
<TextView android:id="@+id/labelInt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/entryAmount" android:text="The Interest:" />
<EditText android:id="@+id/entryInt" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/labelInt" android:inputType="numberDecimal" android:layout_marginBottom="10dip" />
<TextView android:id="@+id/labelTerm" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/entryInt" android:text="The Term (months):" />
<EditText android:id="@+id/entryTerm" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/labelTerm" android:inputType="numberDecimal" android:layout_marginBottom="10dip" />
<TextView android:id="@+id/labelEMI" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@id/entryTerm" android:text="@string/theEMI" />
<EditText android:id="@+id/entryEMI" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:drawable/editbox_background" android:layout_below="@id/labelEMI" android:inputType="numberDecimal" android:layout_marginBottom="10dip"/>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_weight="1" android:orientation="horizontal" android:layout_height="wrap_content" android:layout_width="fill_parent">
<Button
android:id="@+id/buttonCalculate"
android:layout_width="wrap_content"
android:width="200dip"
android:text="@string/butCalc"
android:lines="1"
android:layout_centerHorizontal="true"
android:height="20dip" android:gravity="center_vertical|center_horizontal" android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
But When I see this Emulator (or my mobile), it looks like "Layout in Emulator.jpg" {attached}. Its much worse!
I want the radio button to be aligned with each text box. I tried to wrap it vertically and i thought it would get aligned automatically. It turned to be not that easy...
Can someone help me fix the issue...
thanks in advance