TextView don't go on center and ImageButton don't go on right

TextView don't go on center and ImageButton don't go on right

i have problem with layout with ImageButton!!!

i want insert ma ImageButton on right but don't go....

this is my code!!!

 <LinearLayout  
        android:id="@+id/top" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:layout_alignParentTop="true" 
         android:paddingLeft="5dp" 
        android:paddingRight="5dp" 
        android:orientation="horizontal" >  
              
        <ImageButton android:id="@+id/btn1"   
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:src="@drawable/icon1" 
                android:gravity="left"/>  
          
        <TextView android:id="@+id/titolo" 
                android:layout_height="wrap_content" 
                android:layout_width="wrap_content" 
                android:text="try" 
                android:textSize="20dp" 
                android:textColor="#ffffff" 
                android:gravity="center"/>  
 
        <ImageButton  
            android:id="@+id/btn2" 
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content" 
            android:gravity="right" 
            android:layout_alignParentRight="true"          
            android:src="@drawable/icon2" />  
 
    </LinearLayout> 
 <LinearLayout
        android:id="@+id/top"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
  android:layout_alignParentTop="true"
   android:paddingLeft="5dp"
        android:paddingRight="5dp"
        android:orientation="horizontal" >
           
        <ImageButton android:id="@+id/btn1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/icon1"
                android:gravity="left"/>
       
        <TextView android:id="@+id/titolo"
                android:layout_height="wrap_content"
                android:layout_width="wrap_content"
                android:text="try"
                android:textSize="20dp"
                android:textColor="#ffffff"
                android:gravity="center"/>

        <ImageButton
            android:id="@+id/btn2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:layout_alignParentRight="true"       
            android:src="@drawable/icon2" />

    </LinearLayout>
 

the TextView don't go on center and ImageButton don't go on right....

where is the error!!???

help me please!!!

Can you give us some idea of what the layout you want looks like, and what the layout you made actually looks like? It isn't clear what the problem is

Copyright © 2007-2012 www.chuibin.com Chuibin Copyright