I am using this code for the image:
<ImageView android:src="@drawable/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dip"/>
I want the logo to be centered , it can be done by varying the Layout margin left value and check and position it, but is there any command to get it centered?
Try to use
RelativeLayout:If you want to use only
horizonal alignment, only removeandroid:layout_centerVertical="true"fromXML resource.