Motorolla XOOM, Android 3.2. After my resource preloader(you can see a progressbar of it on the picture below) has finished his work, this window shows up, but it's height is not stretched to fill all screen. How can it be fixed?
Image: http://img441.imageshack.us/img441/1523/device20120319140942.png
Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mainMenu"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/menu_bg" >
<RelativeLayout
android:id="#+id/button_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<Button
android:id="#+id/continue_button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:background="#drawable/derp"
android:text="#string/continue_text"
android:textColor="#color/main_red"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/play"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/continue_button"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/playGame"
android:textColor="#color/main_blue"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/leaderboard"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/play"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/leaderboard"
android:textColor="#color/main_blue"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/settings"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/leaderboard"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/settings"
android:textColor="#color/main_blue"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/exit"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/settings"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/closeGame"
android:textColor="#color/main_blue"
android:textSize="30dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:id="#+id/nickname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#id/button_layout"
android:text="TextView"
android:layout_marginBottom="30dp"
android:layout_centerHorizontal="true"
android:textColor="#color/main_red"
android:textSize="20dp" />
<TextView
android:id="#+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#id/button_layout"
android:layout_marginTop="50dp"
android:text="TextView"
android:textColor="#color/main_blue"
android:textSize="14dp" />
</RelativeLayout>
Try with this code
<RelativeLayout
android:id="#+id/button_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<Button
android:id="#+id/continue_button"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_centerHorizontal="true"
android:background="#drawable/derp"
android:text="#string/continue_text"
android:textColor="#ff0000"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/play"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/continue_button"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/playGame"
android:textColor="#ff0000"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/leaderboard"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/play"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/leaderboard"
android:textColor="#ff0000"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/settings"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/leaderboard"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/settings"
android:textColor="#ff0000"
android:textSize="30dp"
android:textStyle="bold" />
<Button
android:id="#+id/exit"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_below="#id/settings"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:background="#drawable/derp"
android:text="#string/closeGame"
android:textColor="#ff0000"
android:textSize="30dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:id="#+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_below="#id/button_layout"
android:layout_marginTop="50dp"
android:text="TextView"
android:textColor="#ff0000"
android:textSize="14dp" />
this code working for me
If this is also not working you have to use weight concept
Correct code check this xml file linearlayout missing in the top entry
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/mainMenu" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="#drawable/add_pic">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:layout_centerInParent="true" android:gravity="center">
<TextView android:id="#+id/nickname" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_above="#id/button_layout"
android:text="TextView" android:layout_marginBottom="30dp"
android:layout_centerHorizontal="true" android:textColor="#ff0000"
android:textSize="20dp" />
<RelativeLayout android:id="#+id/button_layout"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_centerInParent="true">
<Button android:id="#+id/continue_button"
android:layout_width="wrap_content" android:layout_height="40dp"
android:layout_centerHorizontal="true" android:background="#drawable/derp"
android:text="#string/continue_text" android:textColor="#ff0000"
android:textSize="30dp" android:textStyle="bold" />
<Button android:id="#+id/play" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_below="#id/continue_button"
android:layout_centerHorizontal="true" android:layout_marginTop="10dp"
android:background="#drawable/derp" android:text="#string/playGame"
android:textColor="#ff0000" android:textSize="30dp"
android:textStyle="bold" />
<Button android:id="#+id/leaderboard" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_below="#id/play"
android:layout_centerHorizontal="true" android:layout_marginTop="10dp"
android:background="#drawable/derp" android:text="#string/leaderboard"
android:textColor="#ff0000" android:textSize="30dp"
android:textStyle="bold" />
<Button android:id="#+id/settings" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_below="#id/leaderboard"
android:layout_centerHorizontal="true" android:layout_marginTop="10dp"
android:background="#drawable/derp" android:text="#string/settings"
android:textColor="#ff0000" android:textSize="30dp"
android:textStyle="bold" />
<Button android:id="#+id/exit" android:layout_width="wrap_content"
android:layout_height="40dp" android:layout_below="#id/settings"
android:layout_centerHorizontal="true" android:layout_marginTop="10dp"
android:background="#drawable/derp" android:text="#string/closeGame"
android:textColor="#ff0000" android:textSize="30dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView android:id="#+id/version" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_centerHorizontal="true"
android:layout_below="#id/button_layout" android:layout_marginTop="50dp"
android:text="TextView" android:textColor="#ff0000" android:textSize="14dp" />
</LinearLayout>
</RelativeLayout>
Related
I was trying to find a way to scroll my Relative Layout while I'm in designer in Intellij, since I can't see all the elements I want and position them right. I researched and read numerous threads and the advice I saw most was "wrap the layout you want to scroll in ScrollView", which I did, but that didn't help me. I still can't see all of my widgets and when I put them near the end of the screen, they either shrink or get positioned below - where I can't see them and manage them. I'm new to all this, so I guess I must be doing something wrong.
I apologize in advance if the answer to this question already exists, I couldn't find it
Here's my XML :
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/ScrollView02"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:nestedScrollingEnabled="true"
android:scrollIndicators="right"
tools:scrollY="150px" android:addStatesFromChildren="true" android:isScrollContainer="true"
android:scrollbarAlwaysDrawHorizontalTrack="false" android:scrollY="300dp">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
android:paddingBottom="#dimen/activity_vertical_margin"
>
<ImageButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/imageButton3"
android:layout_alignParentTop="true" android:layout_alignParentStart="false"
android:layout_alignParentEnd="true" android:background="#drawable/abc_ic_menu_overflow_material"
android:clickable="true"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TITLE"
android:id="#+id/textView7" android:layout_below="#+id/imageButton3"
android:layout_centerHorizontal="true" android:textSize="25dp" android:textStyle="bold"/>
<Spinner
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="#+id/spinner"
android:layout_marginLeft="20dp" android:layout_marginRight="20dp"
android:layout_above="#+id/textView9" android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"/>
<SeekBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/seekBar"
android:layout_alignBottom="#+id/weight_button" android:layout_toEndOf="#+id/weight_button"
android:layout_marginBottom="12dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="First"
android:id="#+id/textView9"
android:layout_above="#+id/textView10" android:layout_alignStart="#+id/spinner"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="< >"
android:id="#+id/textView10"
android:textStyle="bold"
android:textSize="20dp"
android:layout_above="#+id/seekBar" android:layout_toStartOf="#+id/imageButton3"/>
<Button
android:layout_width="50dp"
android:layout_height="50dp"
android:id="#+id/weight_button"
android:text="80"
android:allowUndo="true"
android:background="#drawable/round_button_weight"
android:layout_marginLeft="5dp" android:textColor="#android:color/white"
android:layout_above="#+id/textView11" android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="17dp"/>
<LinearLayout android:orientation="horizontal" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/weight_button"
android:layout_alignEnd="#+id/imageButton3" android:id="#+id/linearLayout2"
android:layout_marginTop="10dp" android:layout_alignLeft="#+id/weight_button">
</LinearLayout>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView11"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_alignParentStart="true" android:layout_marginBottom="10dp"
android:layout_above="#+id/textView12"/>
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:id="#+id/seekBar2"
android:layout_centerVertical="true" android:layout_toEndOf="#+id/button"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Second"
android:id="#+id/textView12"
android:layout_above="#+id/button" android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="5dp" android:layout_marginTop="10dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="< >"
android:id="#+id/textView13" android:textStyle="bold" android:textSize="20dp"
android:layout_below="#+id/textView12" android:layout_alignEnd="#+id/spinner"/>
<Button android:layout_width="50dp" android:layout_height="50dp" android:id="#+id/button" android:text="175"
android:allowUndo="true" android:background="#drawable/round_button_height"
android:textColor="#android:color/white"
android:layout_centerVertical="true" android:layout_toStartOf="#+id/seekBar"/>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView14"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_below="#+id/button" android:layout_alignLeft="#+id/textView11"
android:layout_marginTop="10dp" android:layout_marginBottom="5dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Third"
android:id="#+id/textView15"
android:layout_below="#+id/textView14" android:layout_alignStart="#+id/button2"
android:layout_marginBottom="5dp" android:layout_marginTop="10dp"/>
<Button android:layout_width="50dp" android:layout_height="50dp" android:id="#+id/button2" android:text="24"
android:allowUndo="true" android:background="#drawable/round_button_height"
android:textColor="#android:color/white"
android:layout_alignTop="#+id/textView16" android:layout_toStartOf="#+id/seekBar3"
android:layout_marginBottom="20dp"/>
<SeekBar android:layout_width="match_parent" android:layout_height="wrap_content" android:id="#+id/seekBar3"
android:layout_alignBottom="#+id/button2" android:layout_alignStart="#+id/seekBar2"
android:layout_marginBottom="12dp"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="< >"
android:id="#+id/textView16" android:textStyle="bold" android:textSize="20dp"
android:layout_below="#+id/textView15"
android:layout_alignRight="#+id/textView10" android:layout_alignLeft="#+id/textView10"/>
<TextView android:layout_width="match_parent" android:layout_height="1dp" android:id="#+id/textView17"
android:background="#555252" android:layout_weight="1" android:layout_gravity="center_vertical"
android:layout_below="#+id/button2"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0-6"
android:id="#+id/radioButton1"
android:layout_marginTop="37dp" android:checked="false"
android:layout_below="#+id/textView17" android:layout_alignEnd="#+id/textView9"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="6-18"
android:id="#+id/radioButton2"
android:checked="false"
android:layout_alignTop="#+id/radioButton3" android:layout_centerHorizontal="true"/>
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=">18"
android:id="#+id/radioButton3"
android:checked="false"
android:layout_alignTop="#+id/radioButton1" android:layout_alignEnd="#+id/textView16"
android:layout_marginEnd="26dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Title1"
android:id="#+id/textView18"
android:textStyle="bold"
android:textSize="15dp" android:layout_above="#+id/radioButton2" android:layout_alignParentStart="false"
android:padding="10dp" android:textAllCaps="true" android:textColor="#android:color/white"
android:background="#3b3c50" android:layout_marginTop="20dp" android:layout_marginBottom="10dp"/>
<TextView android:layout_width="match_parent" android:layout_height="wrap_content"
android:text="Title2" android:id="#+id/textView19"
android:textStyle="bold"
android:textSize="15dp" android:layout_below="#+id/radioButton1"
android:layout_alignStart="#+id/textView18" android:layout_marginTop="10dp"
android:layout_marginBottom="10dp" android:padding="10dp" android:textAllCaps="true"
android:textColor="#android:color/white" android:background="#3b3c50"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"
android:id="#+id/radioButton" android:checked="false"
android:layout_below="#+id/textView19" android:layout_alignStart="#+id/radioButton1"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"
android:id="#+id/radioButton4" android:checked="false"
android:layout_below="#+id/textView19" android:layout_alignEnd="#+id/textView7"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"
android:id="#+id/radioButton5" android:checked="false"
android:layout_alignTop="#+id/radioButton4" android:layout_alignEnd="#+id/textView13"/>
<TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Title 3"
android:id="#+id/textView20" android:textStyle="bold" android:textSize="15dp"
android:layout_below="#+id/radioButton" android:layout_alignStart="#+id/textView19"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"
android:textColor="#android:color/white" android:background="#3b3c50" android:textAllCaps="true"
android:padding="10dp"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1"
android:id="#+id/radioButton6" android:checked="false"
android:layout_below="#+id/textView20" android:layout_alignStart="#+id/radioButton"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2"
android:id="#+id/radioButton7" android:checked="false"
android:layout_alignTop="#+id/radioButton6" android:layout_alignStart="#+id/radioButton4"/>
<RadioButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3"
android:id="#+id/radioButton8" android:checked="false"
android:layout_alignTop="#+id/radioButton7" android:layout_alignStart="#+id/radioButton5"/>
<TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Title4"
android:id="#+id/textView21" android:textStyle="bold" android:textSize="15dp"
android:layout_below="#+id/radioButton8" android:layout_alignStart="#+id/textView20"
android:layout_marginTop="10dp" android:layout_marginBottom="10dp"/>
</RelativeLayout>
</ScrollView>
You can add LinearLayout under ScrollView and then put RelativeLayout under LinearLayout.
Try this i have edited your layout file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/ScrollView02"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:addStatesFromChildren="true"
android:fillViewport="true"
android:isScrollContainer="true"
android:nestedScrollingEnabled="true"
android:scrollIndicators="right"
android:scrollbarAlwaysDrawHorizontalTrack="false"
tools:scrollY="150px">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin">
<ImageButton
android:id="#+id/imageButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:background="#drawable/abc_ic_menu_overflow_material"
android:clickable="true" />
<TextView
android:id="#+id/textView7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/imageButton3"
android:layout_centerHorizontal="true"
android:text="TITLE"
android:textSize="25dp"
android:textStyle="bold" />
<Spinner
android:id="#+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView9"
android:layout_centerHorizontal="true"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp" />
<SeekBar
android:id="#+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/weight_button"
android:layout_marginBottom="12dp"
android:layout_toRightOf="#+id/weight_button"
android:layout_toEndOf="#+id/weight_button" />
<TextView
android:id="#+id/textView9"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/textView10"
android:layout_alignLeft="#+id/spinner"
android:layout_alignStart="#+id/spinner"
android:text="First" />
<TextView
android:id="#+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/seekBar"
android:layout_toLeftOf="#+id/imageButton3"
android:layout_toStartOf="#+id/imageButton3"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/weight_button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_above="#+id/textView11"
android:layout_alignLeft="#+id/textView9"
android:layout_alignStart="#+id/textView9"
android:layout_marginBottom="17dp"
android:layout_marginLeft="5dp"
android:allowUndo="true"
android:background="#drawable/round_button_weight"
android:text="80"
android:textColor="#android:color/white" />
<LinearLayout
android:id="#+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/imageButton3"
android:layout_alignRight="#+id/imageButton3"
android:layout_alignLeft="#+id/weight_button"
android:layout_below="#+id/weight_button"
android:layout_marginTop="10dp"
android:orientation="horizontal"></LinearLayout>
<TextView
android:id="#+id/textView11"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_above="#+id/textView12"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_gravity="center_vertical"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="#555252" />
<SeekBar
android:id="#+id/seekBar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="#+id/button"
android:layout_toRightOf="#+id/button" />
<TextView
android:id="#+id/textView12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/button"
android:layout_alignStart="#+id/textView9"
android:layout_alignLeft="#+id/textView9"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:text="Second" />
<TextView
android:id="#+id/textView13"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/spinner"
android:layout_alignRight="#+id/spinner"
android:layout_below="#+id/textView12"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<Button
android:id="#+id/button"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toStartOf="#+id/seekBar"
android:layout_toLeftOf="#+id/seekBar"
android:allowUndo="true"
android:background="#drawable/round_button_height"
android:text="175"
android:textColor="#android:color/white" />
<TextView
android:id="#+id/textView14"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignLeft="#+id/textView11"
android:layout_below="#+id/button"
android:layout_gravity="center_vertical"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="#555252" />
<TextView
android:id="#+id/textView15"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/button2"
android:layout_alignLeft="#+id/button2"
android:layout_below="#+id/textView14"
android:layout_marginBottom="5dp"
android:layout_marginTop="10dp"
android:text="Third" />
<Button
android:id="#+id/button2"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignTop="#+id/textView16"
android:layout_marginBottom="20dp"
android:layout_toStartOf="#+id/seekBar3"
android:layout_toLeftOf="#+id/seekBar3"
android:allowUndo="true"
android:background="#drawable/round_button_height"
android:text="24"
android:textColor="#android:color/white" />
<SeekBar
android:id="#+id/seekBar3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/button2"
android:layout_alignStart="#+id/seekBar2"
android:layout_alignLeft="#+id/seekBar2"
android:layout_marginBottom="12dp" />
<TextView
android:id="#+id/textView16"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/textView10"
android:layout_alignRight="#+id/textView10"
android:layout_below="#+id/textView15"
android:text="< >"
android:textSize="20dp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView17"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#+id/button2"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:background="#555252" />
<RadioButton
android:id="#+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView9"
android:layout_alignRight="#+id/textView9"
android:layout_below="#+id/textView17"
android:layout_marginTop="37dp"
android:checked="false"
android:text="0-6" />
<RadioButton
android:id="#+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="#+id/radioButton3"
android:layout_centerHorizontal="true"
android:checked="false"
android:text="6-18" />
<RadioButton
android:id="#+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView16"
android:layout_alignRight="#+id/textView16"
android:layout_alignTop="#+id/radioButton1"
android:layout_marginEnd="26dp"
android:layout_marginRight="26dp"
android:checked="false"
android:text=">18" />
<TextView
android:id="#+id/textView18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="#+id/radioButton2"
android:layout_alignParentStart="false"
android:layout_alignParentLeft="false"
android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title1"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/textView19"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView18"
android:layout_alignLeft="#+id/textView18"
android:layout_below="#+id/radioButton1"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title2"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton1"
android:layout_alignLeft="#+id/radioButton1"
android:layout_below="#+id/textView19"
android:checked="false"
android:text="1" />
<RadioButton
android:id="#+id/radioButton4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView7"
android:layout_alignRight="#+id/textView7"
android:layout_below="#+id/textView19"
android:checked="false"
android:text="2" />
<RadioButton
android:id="#+id/radioButton5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignEnd="#+id/textView13"
android:layout_alignRight="#+id/textView13"
android:layout_alignTop="#+id/radioButton4"
android:checked="false"
android:text="3" />
<TextView
android:id="#+id/textView20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView19"
android:layout_alignLeft="#+id/textView19"
android:layout_below="#+id/radioButton"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:background="#3b3c50"
android:padding="10dp"
android:text="Title 3"
android:textAllCaps="true"
android:textColor="#android:color/white"
android:textSize="15dp"
android:textStyle="bold" />
<RadioButton
android:id="#+id/radioButton6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton"
android:layout_alignLeft="#+id/radioButton"
android:layout_below="#+id/textView20"
android:checked="false"
android:text="1" />
<RadioButton
android:id="#+id/radioButton7"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton4"
android:layout_alignLeft="#+id/radioButton4"
android:layout_alignTop="#+id/radioButton6"
android:checked="false"
android:text="2" />
<RadioButton
android:id="#+id/radioButton8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/radioButton5"
android:layout_alignLeft="#+id/radioButton5"
android:layout_alignTop="#+id/radioButton7"
android:checked="false"
android:text="3" />
<TextView
android:id="#+id/textView21"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignStart="#+id/textView20"
android:layout_alignLeft="#+id/textView20"
android:layout_below="#+id/radioButton8"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:text="Title4"
android:textSize="15dp"
android:textStyle="bold" />
</RelativeLayout>
Thank you for your suggestions, but neither of them did help. After I updated IntelliJ to 3.x version, it worked, without changing the code.
I'm trying to insert some pixel art for my app as an ImageView, but it's very stubborn once I have it in. Specifically, it's centered and pretty much locked into a grid.
I would like to naturally place the sprite where I want to instead of having it snap to a grid. Any suggestions? Here it is:
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="#drawable/cloud1" />
EDIT: Full XML
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="Enter Two Numbers"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold" />
<EditText
android:id="#+id/editOp1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:ems="10"
android:inputType="numberDecimal" >
<requestFocus />
</EditText>
<EditText
android:id="#+id/editOp2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:inputType="numberDecimal" />
<TableRow
android:id="#+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="15dp"
android:gravity="center" >
<ImageButton
android:id="#+id/btnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#null"
android:src="#drawable/sun" />
<Button
android:id="#+id/btnSubtract"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textStyle="bold" />
<Button
android:id="#+id/btnDivide"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="/"
android:textStyle="bold" />
<Button
android:id="#+id/btnMultiply"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="*"
android:textStyle="bold" />
<Button
android:id="#+id/clear"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CLR" />
</TableRow>
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="15dp"
android:gravity="center"
android:text="RESULT"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="#+id/result"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="0.00"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:src="#drawable/grass" />
<ImageView
android:id="#+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageView2"
android:src="#drawable/grass" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_toRightOf="#+id/imageView3"
android:src="#drawable/grass" />
<ImageView
android:id="#+id/imageView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/imageView4"
android:layout_marginLeft="12dp"
android:layout_marginTop="14dp"
android:src="#drawable/cloud2" />
<ImageView
android:id="#+id/imageView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="43dp"
android:src="#drawable/cloud1" />
</RelativeLayout>
All you wanted to do is make the xml layout root as RelativeLayout & Go to Design tab, drag to where ever you want it to be.
Hope it helps!
i am stuck how to scroll layout when keyboard appear? this is my static page but when my keyboard appear then my scrollview is not working.i can not give hard code height of scrollview. please help me..
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/settingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#drawable/splash_bg" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
</ScrollView>
Please help me out.
suggestions apreciated
Thanks Kind Regards.
Try this:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/splash_bg" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
And add this code to ypur manifest project:
<activity
android:name="YourActivity"
android:windowSoftInputMode="stateVisible|stateAlwaysVisible" >
</activity>
add this code in ur manifest activty
android:windowSoftInputMode="adjustPan|stateAlwaysVisible"
this code useful for scrolling relative layout..
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<RelativeLayout
android:id="#+id/settingLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/splash_bg" >
<ImageView
android:id="#+id/tree_iv_userSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:background="#drawable/tree_transparent" />
<ImageView
android:id="#+id/image1"
android:layout_width="90dp"
android:layout_height="110dp"
android:layout_centerHorizontal="true"
android:layout_marginBottom="30dp"
android:src="#drawable/frame_large" />
<TextView
android:id="#+id/changepassword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/image1"
android:layout_marginLeft="20dp"
android:background="#android:color/transparent"
android:hint="CHANGE PASSWORD"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/changepassword"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT NAME"
android:maxLength="20"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<EditText
android:id="#+id/editphoneno"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editname"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:hint="EDIT PHONE NUMBER"
android:maxLength="15"
android:numeric="integer"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColorHint="#android:color/black" />
<TextView
android:id="#+id/edittype"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/editphoneno"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="EDIT TYPE"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<TextView
android:id="#+id/notification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/edittype"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:background="#android:color/transparent"
android:singleLine="true"
android:text="NOTIFICATION"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black" />
<Button
android:id="#+id/togNot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="#+id/save"
android:layout_alignParentRight="true"
android:layout_marginRight="20dp"
android:background="#drawable/on_button" />
<TextView
android:id="#+id/save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="#+id/notification"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp"
android:background="#android:color/transparent"
android:text="SAVE "
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#android:color/black"
android:textSize="40dp" />
<ProgressBar
android:id="#+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/image1"
android:layout_centerHorizontal="true"
android:layout_marginBottom="27dp" />
</RelativeLayout>
<RelativeLayout
android:id="#+id/bottomRelay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_margin="7.5dp"
android:background="#android:color/transparent"
android:visibility="gone" >
<TextView
android:id="#+id/Upload"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#ededed"
android:gravity="center"
android:text="Upload Photo"
android:textColor="#8F8F8F"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/Upload"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/choose_existing"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border1"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="1dp"
android:background="#ededed"
android:gravity="center"
android:text="Library"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border2"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/choose_existing"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/Camera"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border2"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="1dp"
android:background="#ededed"
android:gravity="center"
android:text="Camera"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
<ImageView
android:id="#+id/border3"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/Camera"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:background="#939393" />
<TextView
android:id="#+id/cancel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="#+id/border3"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_marginTop="20dp"
android:background="#ededed"
android:gravity="center"
android:text="Cancel"
android:textColor="#007AFF"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
</RelativeLayout>
</ScrollView>
I have a RelativeLayout which includes a Spinner and some RadioButtons, based on the selection of these I have to hide some views and make others visible. The problem is if I make the views GONE by view.setVisibility(View.GONE) the layout gets messed up, the views overlap, if I use view.Visibility(View.INVISIBLE) everything is fine but the missing views create a void on the page. I want to push the views beneath up to properly augment the page. Below is a better explanation:
So far the code I have is:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#drawable/bg_app" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideOverlay"
android:scrollbars="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true" >
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="60dp"
android:background="#drawable/drop_down" />
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_below="#+id/textView5"
android:layout_marginTop="30dp"
android:text="xxx"
android:textColor="#002f44"
android:textSize="18sp" />
<Button
android:id="#+id/button2"
android:layout_width="170dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignRight="#+id/spinner1"
android:background="#drawable/btn_calendar"
android:textColor="#FFBF00" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="20dp"
android:scaleType="centerCrop" />
<AutoCompleteTextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/spinner1"
android:layout_alignTop="#+id/imageView1"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/imageView1"
android:ems="6"
android:hint="xx xx"
android:inputType="textPersonName"
android:maxLength="25"
android:textColor="#002f44" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText1"
android:layout_below="#+id/editText1"
android:padding="03dp"
android:textColor="#610B0B" />
<Button
android:id="#+id/button1"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_alignLeft="#+id/textView2"
android:layout_below="#+id/textView2"
android:background="#drawable/btn_addreminder"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_below="#+id/spinner1"
android:layout_marginTop="20dp"
android:text="xxx "
android:textColor="#002f44"
android:textSize="18sp" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_alignRight="#+id/spinner1"
android:layout_alignTop="#+id/textView4"
android:layout_marginTop="-5dp"
android:background="#drawable/widget_style"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="xxx"
android:textColor="#002f44" />
<RadioButton
android:id="#+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="xxx"
android:textColor="#002f44" />
</RadioGroup>
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_below="#+id/radioGroup1"
android:layout_marginTop="25dp"
android:text="xxx"
android:textColor="#002f44"
android:textSize="18sp" />
<AutoCompleteTextView
android:id="#+id/autoname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignRight="#+id/spinner1"
android:ellipsize="end"
android:ems="8"
android:hint="xx xx"
android:maxLines="1"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#002f44" >
</AutoCompleteTextView>
<Button
android:id="#+id/button4"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignLeft="#+id/imageView1"
android:layout_below="#+id/button1"
android:layout_marginLeft="05dp"
android:layout_marginTop="66dp"
android:background="#drawable/btn_addreminder"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<Button
android:id="#+id/Button01"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="#drawable/btn_addreminder"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<Button
android:id="#+id/Button02"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignBaseline="#+id/button4"
android:layout_alignBottom="#+id/button4"
android:layout_alignRight="#+id/editText1"
android:background="#drawable/btn_addreminder"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
</RelativeLayout>
</ScrollView>
</RelativeLayout>
You should use alignWithParentIfMissing attribute.
I've reworked your layout, try it
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:isScrollContainer="true"
android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbarStyle="insideOverlay"
android:scrollbars="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<Spinner
android:id="#+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="60dp" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:paddingLeft="20dp"
android:paddingRight="20dp" >
<TextView
android:id="#+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/textView5"
android:layout_marginTop="30dp"
android:text="xxx"
android:textColor="#002f44"
android:textSize="18sp" />
<Button
android:id="#+id/button2"
android:layout_width="170dp"
android:layout_height="30dp"
android:layout_alignBaseline="#+id/textView1"
android:layout_alignParentRight="true"
android:textColor="#FFBF00" />
<TextView
android:id="#+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:visibility="invisible" />
<ImageView
android:id="#+id/imageView1"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_alignLeft="#+id/textView1"
android:layout_below="#+id/textView1"
android:layout_marginTop="20dp"
android:scaleType="centerCrop" />
<AutoCompleteTextView
android:id="#+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/imageView1"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_toRightOf="#+id/imageView1"
android:ems="6"
android:hint="xx xx"
android:inputType="textPersonName"
android:maxLength="25"
android:textColor="#002f44" />
<TextView
android:id="#+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/editText1"
android:layout_below="#+id/editText1"
android:padding="03dp"
android:textColor="#610B0B" />
<Button
android:id="#+id/button1"
android:layout_width="120dp"
android:layout_height="50dp"
android:layout_alignLeft="#+id/textView2"
android:layout_below="#+id/textView2"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<TextView
android:id="#+id/textView4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:text="xxx "
android:textColor="#002f44"
android:textSize="18sp" />
<RadioGroup
android:id="#+id/radioGroup1"
android:layout_width="180dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignTop="#+id/textView4"
android:layout_marginTop="-5dp"
android:orientation="horizontal" >
<RadioButton
android:id="#+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="xxx"
android:textColor="#002f44" />
<RadioButton
android:id="#+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="xxx"
android:textColor="#002f44" />
</RadioGroup>
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="#+id/radioGroup1"
android:layout_marginTop="25dp"
android:text="xxx"
android:textColor="#002f44"
android:textSize="18sp" />
<AutoCompleteTextView
android:id="#+id/autoname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="#+id/textView5"
android:layout_alignParentRight="true"
android:ellipsize="end"
android:ems="8"
android:hint="xx xx"
android:maxLines="1"
android:scrollHorizontally="true"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#002f44" >
</AutoCompleteTextView>
<Button
android:id="#+id/button4"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignLeft="#+id/imageView1"
android:layout_below="#+id/button1"
android:layout_marginLeft="05dp"
android:layout_marginTop="66dp"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<Button
android:id="#+id/Button01"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
<Button
android:id="#+id/Button02"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_alignBaseline="#+id/button4"
android:layout_alignBottom="#+id/button4"
android:layout_alignRight="#+id/editText1"
android:text="xxx"
android:textColor="#002f44"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</RelativeLayout>
Use LinearLayout(vertical) inside ScrollView and create RelativeLayouts as child of this LinearLayout. Set height of these RelativeLayout as wrap content, so that as you set visibility of items as GONE its height will shrink.
Now as per image that you have given here, you can have spinner first then below that a relative layout which will contain two (horizontal) items that you wanna hide. then next two (horizontal) items in another layout and then your image, editText and Button in third layout.
So you hide any relative layout others will arrange properly.
I would recommend to create a view of height 1dp with transparent background below texView4 and then set android:layout_below="#id/view" attribute for textView5. Here is how the changes to the layout would look like:
</RadioGroup> <!-- RadioGroup ends -->
<View
android:id="#+id/view"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="#id/textView4"
android:background="#color/transparent"/>
<!-- Changed layout_below attribute value -->
<TextView
android:id="#+id/textView5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/spinner1"
android:layout_below="#id/view"
android:layout_marginTop="25dp"
android:text="xxx"
android:textColor="#002f44"
android:textSize="18sp" />
And here is how the layout looks like with textView4 and RadioGroup gone:
I am using header and footer and also use scroll view in within content part only.
if i run that application in emulator it display header and content part only. Footer view is missing in my application.
Here my code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:id="#+id/rl_header"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="#drawable/head" >
<TextView android:id="#+id/txtTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="#string/gebrauchte"
android:textColor="#fff"
android:textStyle="bold"
android:textSize="20dp"/> </RelativeLayout>
<ScrollView
android:id="#+id/scrollView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rl_header"
>
<RelativeLayout
android:id="#+id/ll_bikeDetail"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#fff" >
<RelativeLayout
android:id="#+id/rl_bikeDetail"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#fff" >
<TextView
android:id="#+id/txtDetail"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginLeft="8dp"
android:text="#string/detail"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/txtDetail1"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginLeft="130dp"
android:text="#string/pass"
android:textColor="#000"
android:textSize="13dp" android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/txtDynamic"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="267dp"
android:text="2175"
android:textStyle="bold" android:layout_marginTop="5dp"/>
<View
android:id="#+id/img_hrDetail"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/txtDetail"
android:background="#FF909090" />
<TextView
android:id="#+id/txtBikeType"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrDetail"
android:layout_marginLeft="8dp"
android:text="#string/biketype"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/txtBike"
android:layout_width="wrap_content"
android:layout_height="23dp"
android:layout_below="#+id/img_hrDetail"
android:layout_marginLeft="110dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="15dp" android:layout_marginTop="5dp"/>
<Button
android:id="#+id/btn_arwBikeType"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/img_hrDetail"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" android:layout_marginTop="5dp"/>
<View
android:id="#+id/img_hrBikeType"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/txtBikeType"
android:background="#FF909090" />
<TextView
android:id="#+id/txtMarke"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrBikeType"
android:layout_marginLeft="8dp"
android:text="#string/mark"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtMarkeBe"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrBikeType"
android:layout_marginLeft="110dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="15dp" />
<Button
android:id="#+id/btn_arwBrand"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/img_hrBikeType"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtModel"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtMarke"
android:layout_marginLeft="8dp"
android:text="#string/model"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtModelBe"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtMarke"
android:layout_marginLeft="110dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="15dp" />
<Button
android:id="#+id/btn_arwModel"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtMarke"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<View
android:id="#+id/img_hrModel"
android:layout_width="wrap_content"
android:layout_height="2dp"
android:layout_below="#+id/txtModel"
android:background="#FF909090" />
<TextView
android:id="#+id/txtErst"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="8dp"
android:text="#string/erst"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtErstBe"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="115dp"
android:layout_marginTop="3dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwErstBe"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="170dp"
android:background="#drawable/arrow"/>
<TextView
android:id="#+id/txtErstBis"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="200dp"
android:layout_marginTop="5dp"
android:text="#string/bis"
android:textColor="#000"
android:textSize="13dp" />
<TextView
android:id="#+id/txtErstBel"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="220dp"
android:layout_marginTop="5dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwErst"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/img_hrModel"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtLauf"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtErst"
android:layout_marginLeft="8dp"
android:text="#string/lauf"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtLaufKm"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtErst"
android:layout_marginLeft="115dp"
android:layout_marginTop="3dp"
android:text="#string/km"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwLaufBe"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtErst"
android:layout_marginLeft="170dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtLaufBis"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtErst"
android:layout_marginLeft="200dp"
android:layout_marginTop="3dp"
android:text="#string/bis"
android:textColor="#000"
android:textSize="13dp" />
<TextView
android:id="#+id/txtLaufBel"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtErst"
android:layout_marginLeft="220dp"
android:layout_marginTop="3dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwLauf"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtErst"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtHub"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtLauf"
android:layout_marginLeft="8dp"
android:text="#string/hub"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtHubCcm"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtLauf"
android:layout_marginLeft="115dp"
android:layout_marginTop="3dp"
android:text="#string/ccm"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwHubCcm"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtLauf"
android:layout_marginLeft="170dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtHubBis"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtLauf"
android:layout_marginLeft="200dp"
android:layout_marginTop="3dp"
android:text="#string/bis"
android:textColor="#000"
android:textSize="13dp" />
<TextView
android:id="#+id/txtHubBel"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtLauf"
android:layout_marginLeft="220dp"
android:layout_marginTop="3dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwHub"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtLauf"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtPre"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtHub"
android:layout_marginLeft="8dp"
android:text="#string/pre"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtPreBe"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtHub"
android:layout_marginLeft="115dp"
android:layout_marginTop="3dp"
android:text="#string/sign"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwPreBe"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtHub"
android:layout_marginLeft="170dp"
android:background="#drawable/arrow" />
<TextView
android:id="#+id/txtPreBis"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtHub"
android:layout_marginLeft="200dp"
android:layout_marginTop="3dp"
android:text="#string/bis"
android:textColor="#000"
android:textSize="13dp" />
<TextView
android:id="#+id/txtPreBel"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtHub"
android:layout_marginLeft="220dp"
android:layout_marginTop="3dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwPre"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtHub"
android:layout_marginLeft="280dp"
android:background="#drawable/arrow" />
<View
android:id="#+id/img_hrPre"
android:layout_width="fill_parent"
android:layout_height="2dp"
android:layout_below="#+id/txtPre"
android:background="#FF909090" />
<ProgressBar
android:id="#+id/progressBar1"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="#+id/txtDynamic"
android:layout_alignLeft="#+id/btn_arwBikeType"
android:background="#000" android:layout_marginTop="5dp"/>
</RelativeLayout>
<RelativeLayout
android:id="#+id/rl_Wo"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/rl_bikeDetail"
android:background="#fff" >
<TextView
android:id="#+id/txtWo"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/imgHrule3"
android:layout_marginLeft="8dp"
android:text="#string/wo"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
<com.InternetGMBH.ThousandPS.Utilities.SegmentedRadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" android:layout_below="#+id/img_hrPre"
android:layout_marginLeft="100dp"
android:layout_marginRight="15dp" android:id="#+id/segment_text"
android:checkedButton="#+id/btn_egal"> <RadioButton
android:id="#id/btn_egal" android:minWidth="60dip"
android:minHeight="33dip" android:text="Egal"
android:textAppearance="?android:attr/textAppearanceSmall"
android:button="#null" android:gravity="center"
android:textColor="#color/radio_colors" /> <RadioButton
android:id="#+id/btn_gps" android:minWidth="60dip"
android:minHeight="33dip" android:text="Gps"
android:button="#null" android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/radio_colors" /> <RadioButton
android:id="#+id/btn_eingabe" android:minWidth="60dip"
android:minHeight="33dip" android:text="Eingabe"
android:button="#null" android:gravity="center"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#color/radio_colors" />
</com.InternetGMBH.ThousandPS.Utilities.SegmentedRadioGroup>
<!-- <Button
android:id="#+id/btn_egal"
android:layout_width="70dp"
android:layout_height="35dp"
android:layout_below="#+id/img_hrPre"
android:layout_marginLeft="100dp"
android:layout_marginRight="15dp"
android:text="Egal" android:layout_marginTop="5dp" android:background="#drawable/new_01" android:textColor="#fff"/>
-->
<TextView
android:id="#+id/txtland"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtWo"
android:layout_marginLeft="8dp"
android:layout_marginTop="5dp"
android:text="#string/land"
android:textColor="#000"
android:textSize="15dp"
android:textStyle="bold" />
<TextView
android:id="#+id/txtGpsStatus"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtWo"
android:textStyle="bold"
android:layout_marginTop="3dp"
android:text=""
android:textColor="#000"
android:textSize="15dp"
android:layout_marginLeft="8dp"/>
<TextView
android:id="#+id/txtlandBe"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtWo"
android:layout_marginLeft="110dp"
android:layout_marginTop="8dp"
android:text="#string/belie"
android:textColor="#ff0000"
android:textSize="13dp" />
<TextView
android:id="#+id/txtGpsValue"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#id/txtWo"
android:layout_marginLeft="110dp"
android:layout_marginTop="3dp"
android:text=""
android:textColor="#ff0000"
android:textSize="13dp" />
<Button
android:id="#+id/btn_arwLand"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_below="#+id/txtWo"
android:layout_marginLeft="180dp"
android:background="#drawable/arrow" android:layout_marginTop="5dp"/>
<EditText
android:id="#+id/txt_plz"
android:layout_width="50dp"
android:layout_height="30dp"
android:layout_below="#+id/txtWo"
android:layout_marginLeft="230dp"
android:layout_marginRight="15dp"
android:textSize="10dp" android:layout_marginTop="5dp"/>
<TextView
android:id="#+id/txtmax"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtland"
android:layout_marginLeft="8dp"
android:layout_marginTop="3dp"
android:text="#string/max"
android:textColor="#000"
android:textSize="10dp" />
<TextView
android:id="#+id/txtmaxKm"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_below="#+id/txtland"
android:layout_marginLeft="110dp"
android:layout_marginTop="3dp"
android:text="200 km"
android:textColor="#ff0000"
android:textSize="13dp" />
<SeekBar
android:id="#+id/seekBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="#+id/btn_arwLand"
android:layout_alignRight="#+id/txt_plz"
android:layout_below="#+id/txtlandBe"
android:max="490" />
</RelativeLayout> </RelativeLayout>
</ScrollView>
<RelativeLayout
android:id="#+id/rl_footer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="#+id/scrollView"
android:background="#fff" >
<Button
android:id="#+id/btn_resetForm"
android:layout_width="120dp"
android:layout_height="30dp"
android:layout_alignParentLeft="true"
android:layout_below="#+id/rl_Wo"
android:layout_marginLeft="14dp"
android:layout_marginTop="20dp"
android:background="#drawable/resetform" />
<Button
android:id="#+id/btn_anze"
android:layout_width="120dp"
android:layout_height="30dp"
android:layout_below="#+id/rl_Wo"
android:layout_marginLeft="56dp"
android:layout_marginTop="20dp"
android:layout_toRightOf="#+id/btn_resetForm"
android:background="#drawable/redbutton"
android:text="Anzeigen"
android:textColor="#fff" /> </RelativeLayout>
</RelativeLayout>
any one can help me what's the issue here?
Here my answer,
in footer relative layout just add android:layout_alignParentBottom="true"
<RelativeLayout
android:id="#+id/rl_footer"
android:layout_width="fill_parent"
android:layout_height="46dp"
android:layout_alignParentBottom="true"
android:background="#fff" >
<Button....../>
<Button...../>
</RelativeLayout>