1

Need help, See the following screen, (This is my actual home screen) enter image description here

But, when I run my Application It looks as follows (Screen When I run my application enter image description here

Here I need to drag (Scroll) the screen to see the footer part. I wants to avoid this, Can anybody help me out in this Please. Thank You.!

1
  • @baloo I tried to add Layout XML in my above question, but some how StackOverflow is not accepting it. Really Sorry..! Commented Jul 11, 2013 at 8:45

2 Answers 2

2

hope this will help you. Use following

 <?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"> <!-- header part --> <LinearLayout android:id="@+id/ll_header" android:layout_alignParentTop="true" android:layout_height="wrap_content" android:layout_width="match_parent"> ... </LinearLayout> <!-- scroll view part --> <ScrollView android:id="@+id/sv_container" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_above="@+id/ll_fooetr"> </ScrollView> <!-- footer part --> <LinearLayout android:id="@+id/ll_footer" android:layout_alignParentBottom="true" android:layout_height="wrap_content" android:layout_width="match_parent"> ... </LinearLayout> </RelativeLayout> 
Sign up to request clarification or add additional context in comments.

Comments

0

My suggestion is to use LinearLayout or RelativeLayout for your activity, and inside it use a ScrollView for the inside part (which should be scrolled).

So, perhaps something like this

<?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="match_parent" android:orientation="vertical"> <ScrollView android:layout_height="wrap_content" android:layout_width="match_parent"> <!-- all your scrollable stuff goes here --> </ScrollView> <!-- here's your footer --> <LinearLayout android:layout_height="wrap_content" android:layout_width="match_parent"> ... </LinearLayout> </LinearLayout> 

Documentation on ScrollView

Edit: I think RelativeLayout (as main Layout) will serve you the best, as it allows you to align itself against parent's edges.

Documentation on RelativeLayout

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.