I have a linearLayout with 2 elements, a textView and a imagebutton, I would like to center in the linearlayout the textView and right-aligment for the imageButto, but both of them are at left.
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:background="@color/usualBike"
>
<TextView
android:id="@+id/usesLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="@string/tituloUsos"
android:textSize="30dip"
android:layout_gravity="center"
android:textStyle="bold"
/>
<ImageButton
android:id="@+id/disconnect"
android:background="@null"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/icon_logout" />
</LinearLayout>
how can I get it?
Are you particular about
LinearLayout? if not why don’t you try withRelativeLayoutlike this: