Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I had created a xml file but i had some problem with it.
Here is my xml code
HTML
<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="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"
        tools:context=".MainActivity" 
        android:removed="@drawable/mybackground">
    
      <include layout="@layout/header" />
      
        <include layout="@layout/footer" />
        
        <RelativeLayout 
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_below="@+id/header"
            android:layout_above="@+id/footer"
    >
    <ScrollView 
        android:id="@+id/layout1"
        android:layout_width="fill_parent"
	    android:layout_height="wrap_content"
	    android:orientation="horizontal"
	            >
    <RelativeLayout 
	            
	            android:layout_width="fill_parent"
	            android:layout_height="wrap_content"
	            
	       >
	            <Button 
	                android:id="@+id/shopingbtn"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="Historical"
	                style="?android:attr/buttonStyleSmall"
	                android:background="@drawable/mymenubuttons"
	                android:layout_marginLeft="10dp"/>
	            <Button 
	                android:id="@+id/socialbtn"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="Resorts"
	                style="?android:attr/buttonStyleSmall"
	                android:background="@drawable/mymenubuttons"
	                android:layout_marginLeft="10dp"
	                android:layout_toRightOf="@+id/shopingbtn"/>
	            <Button 
	                android:id="@+id/coupounsbtn"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="Shopping"
	                style="?android:attr/buttonStyleSmall"
	                android:background="@drawable/mymenubuttons"
	                android:layout_marginLeft="10dp"
	                android:layout_toRightOf="@+id/socialbtn"/>
	            <Button 
	                android:id="@+id/foodbtn"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="Theaters"
	                style="?android:attr/buttonStyleSmall"
	                android:background="@drawable/mymenubuttons"
	                android:layout_marginLeft="10dp"
	                android:layout_toRightOf="@+id/coupounsbtn"/>
	            <Button 
	                android:id="@+id/travelbtn"
	                android:layout_width="wrap_content"
	                android:layout_height="wrap_content"
	                android:text="Food"
	                style="?android:attr/buttonStyleSmall"
	                android:background="@drawable/mymenubuttons"
	                android:layout_marginLeft="10dp"
	                android:layout_toRightOf="@+id/foodbtn"
	                />
	        </RelativeLayout>
	        </ScrollView>
   <GridView
        android:id="@+id/gridView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/layout1"
        android:numColumns="3" 
        android:visibility="invisible">

    </GridView>
 

   </RelativeLayout>
   

</RelativeLayout>


In the above code i had 5 buttons in the relative layout under scroll view but the problem is i cannot view all the 5 buttons when i run my app in my phone and that to scroll view also not working.So Please help me
Thanks in Advance.
Posted
Updated 28-Oct-15 19:27pm
v2
Comments
Richard MacCutchan 29-Oct-15 5:54am    
At a guess you have too many levels. Try removing the two intemediate RelativeLayouts and see what happens.
ridoy 30-Oct-15 9:10am    
your design is so weird! Use scrollview as parent element, that will solve all.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900