i am trying to implemnt a app in i wrote code to draw APP Menu .In my application Menu is drawing at top_center of the layout for all resolution as shown in below images.
But i need Buttons at horizontal&vertical center of layout for all resolutions and screens.
Currently i am using below code.
xmlns:tools="http://schemas.android.com/tools" android:id="@+id/myLinear" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#2E9AFE" android:orientation="vertical" tools:context=".MainActivity" > android:id="@+id/textView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center" android:gravity="center" android:text="Choose an Option" android:textAppearance="?android:attr/textAppearanceLarge" android:textColor="@android:color/white" android:textSize="25dp" android:textStyle="bold" android:typeface="sans" /> " android:id="@+id/bDefSms" android:layout_width="256dp" android:layout_height="64dp" android:layout_gravity="center" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:background="@drawable/blackbutton" android:drawableLeft="@drawable/sms" android:paddingBottom="20dp" android:text="AAA" android:textColor="@android:color/white" android:textSize="32dp" android:textStyle="bold" /> android:id="@+id/bSMS" android:layout_width="256dp" android:layout_height="64dp" android:layout_gravity="center" android:layout_marginBottom="10dp" android:background="@drawable/blackbutton" android:drawableLeft="@drawable/defsms" android:text="BBB" android:textColor="@android:color/white" android:textSize="32dp" android:textStyle="bold" /> android:id="@+id/bMMS" android:layout_width="256dp" android:layout_height="64dp" android:layout_gravity="center" android:layout_marginBottom="10dp" android:background="@drawable/blackbutton" android:drawableLeft="@drawable/mms" android:text="CCC" android:textColor="@android:color/white" android:textSize="32dp" android:textStyle="bold" /> android:id="@+id/bMail" android:layout_width="256dp" android:layout_height="64dp" android:layout_gravity="center" android:background="@drawable/blackbutton" android:drawableLeft="@drawable/email" android:text="DDD" android:textColor="@android:color/white" android:textSize="32dp" android:textStyle="bold" />
Please help me.
No comments:
Post a Comment