I have an ImageView inside Linear Layout and this LinearLayout is inside RelativeLayout and this Relative layout is inside ScrollView.
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/white"
android:fillViewport="true"
android:tileMode="repeat" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="30dip"
android:background="@drawable/black"
android:tileMode="repeat">
<ImageButton
android:id="@+id/buttonMainBackClosetheApp"
android:src="@drawable/greenarrow"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/black"
android:tileMode="repeat"/>
<ImageView
android:src="@drawable/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
I want to set the ImageView logo to centre of the LinearLayout. I have attached part of the xml which has the ImageView. I have used ScrollView as such if the application is used in small screens then user can scroll. Full XML is too big as it has been designed on dashboard style. Looking forward to your reply. thanks.