Android Text view position with custom buttons in the layout -


i've following layout

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="fill_parent"     android:layout_height="fill_parent" android:background="@color/all_white"     android:gravity="center">      <button android:id="@+id/mq_categories" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="browse quiz categories" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_random" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="enter random quiz" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_profile" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="my profile" android:textcolor="#edff99"         android:background="@drawable/custom_button" />  </linearlayout> 

which gives output

alt text

now need add welcome text @ top section of screen

when added text view this, welcome text displayed , no buttons , no scroll

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="fill_parent"     android:layout_height="fill_parent" android:background="@color/all_white"     android:gravity="center">      <textview xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/mg_userinfo" android:layout_width="fill_parent"         android:layout_height="fill_parent" android:text="welcome"         android:gravity="center" />      <button android:id="@+id/mq_categories" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="browse quiz categories" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_random" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="enter random quiz" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_profile" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="my profile" android:textcolor="#edff99"         android:background="@drawable/custom_button" />   </linearlayout> 

alt text

when tried below lay out welcome text displayed @ bottom of buttons, buttons got shifted top of screen

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical" android:layout_width="fill_parent"     android:layout_height="fill_parent" android:background="@color/all_white"     android:gravity="center">      <button android:id="@+id/mq_categories" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="browse quiz categories" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_random" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="enter random quiz" android:textcolor="#edff99"         android:background="@drawable/custom_button" />     <button android:id="@+id/mq_profile" android:layout_width="fill_parent"         android:layout_height="wrap_content" android:layout_margin="5dp"         android:text="my profile" android:textcolor="#edff99"         android:background="@drawable/custom_button" />      <textview xmlns:android="http://schemas.android.com/apk/res/android"         android:id="@+id/mg_userinfo" android:layout_width="fill_parent"         android:layout_height="fill_parent" android:text="welcome"         android:gravity="center" />  </linearlayout> 

alt text

how can need add welcome text @ top section of screen button on center?

change following property of textview:

android:layout_width="wrap_content" android:layout_height="wrap_content"  

and put textview above buttons.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -