When I tried you code as you posted, I have this result:
________________________________
| |
| facebook tweeter logo |
|________________________________|
Then, I guess the layout_gravity
attributes are wrong. Also, it seems that you reverse right and left. And the FrameLayout
seems useless in your case (- I wait your answer for my comment to be sure). This layout might achieve what you want:
<?xml version="1.0" encoding="utf-8"?>
<!-- Use fill_horizontal to get the whole actionbar
And center_vertical gravity on all the child views -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/gray"
android:layout_gravity="fill_horizontal"
android:gravity="center_vertical" >
<!-- Use layout_alignParentRight attribute -->
<ImageView
android:id="@+id/facebook"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_fb"
android:layout_alignParentRight="true" />
<!-- Use layout_alignParentLeft attribute -->
<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_hotels"
android:layout_alignParentLeft="true" />
<!-- Use layout_toLeftOf (id) attribute -->
<ImageView
android:id="@+id/tweetter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_tweet"
android:layout_toLeftOf="@id/facebook" />
</RelativeLayout>
I get this output:
________________________________
| |
| logo tweeter facebook |
|________________________________|