2013-11-18 4 views
0
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/main_bg" 
> 

<RelativeLayout android:layout_width="fill_parent" 
    android:layout_height="47dip" android:layout_alignParentTop="true" 
    android:background="@drawable/tab_bar" android:id="@+id/rel_jobDesc"> 

    <TextView android:layout_width="wrap_content" android:id="@+id/txt_SEARCH_TITLE" 
     android:layout_height="wrap_content" android:layout_centerInParent="true" 
     android:text="Description" android:textStyle="bold" android:textSize="20dip" 
     android:textColor="#fff"></TextView> 
</RelativeLayout> 
<ListView 
    android:id="@+id/list" 
    android:cacheColorHint="#00000000" 
    android:layout_marginTop="60dp" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:background="@drawable/job_match_bg" > 

</ListView> 

<Button 
    android:id="@+id/btn_more" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:background="@drawable/viewmore" 
    android:layout_centerHorizontal="true"/> 

</RelativeLayout> 

Я новичок я андроид Developement и я не идея развивать это плз помочь , а также я хочу, чтобы добавить в BottomКак выровнять представления внизу представления списка?

ширина TextView fiil_parent и левой кнопки и текст в центре и правой кнопки

Извините за плохой Английский Любая помощь приветствуется. Спасибо заранее

 moreButton 

 textView 

L-текст кнопки R_button


ответ

1

, если вы ищете L-Button Text R-Button вы необходимо объявление да linearLayout по горизонтали, а затем добавить Button- text- кнопку и добавить веса к ним, чтобы сделать его лучше попробовать этот код:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/main_bg" 
> 

<RelativeLayout android:layout_width="fill_parent" 
android:layout_height="47dip" android:layout_alignParentTop="true" 
android:background="@drawable/tab_bar" android:id="@+id/rel_jobDesc"> 

<TextView android:layout_width="wrap_content" android:id="@+id/txt_SEARCH_TITLE" 
    android:layout_height="wrap_content" android:layout_centerInParent="true" 
    android:text="Description" android:textStyle="bold" android:textSize="20dip" 
    android:textColor="#fff"></TextView> 
</RelativeLayout> 

<ListView 
    android:id="@+id/list" 
    android:cacheColorHint="#00000000" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_above="@+id/linearLayout1" //*** this is important to make the list float over button-text-button 
    android:layout_below="@+id/rel_jobDesc" 
android:background="@drawable/job_match_bg" > 

</ListView> 

<LinearLayout // here what you care about 
    android:id="@+id/linearLayout1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_alignParentBottom="true" 
    android:layout_centerHorizontal="true" 
    > 

    <Button 
     android:id="@+id/btn_more" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.5" 
     android:text="Left" /> 

    <TextView 
     android:id="@+id/Left" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" 
     android:text="TExt!!" 
     /> 

    <Button 
     android:id="@+id/button1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.5" 
     android:text="Right" /> 

</LinearLayout> 

</RelativeLayout> 

вы должны иметь следующий ПОС: PS: Я не имеют фотографии, поэтому я изменил цвет фона

enter image description here

Получить идею, и размешать код так, как вам нравится. если вы не получили эту идею, не стесняйтесь спрашивать меня. Надеюсь, у меня есть то, что вы хотите.

--------------------------------- Редактировать ----------- -------------------------------

здесь, чтобы добавить новую строку над линейной линией и под списком ListView

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/main_bg" 
> 

<RelativeLayout android:layout_width="fill_parent" 
android:layout_height="47dip" android:layout_alignParentTop="true" 
android:background="@drawable/tab_bar" android:id="@+id/rel_jobDesc"> 

<TextView android:layout_width="wrap_content" android:id="@+id/txt_SEARCH_TITLE" 
android:layout_height="wrap_content" android:layout_centerInParent="true" 
android:text="Description" android:textStyle="bold" android:textSize="20dip" 
android:textColor="#fff"></TextView> 
</RelativeLayout> 

<ListView 
android:id="@+id/list" 
android:cacheColorHint="#00000000" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_above="@+id/AboveLinear" //*** this is important to make the list float over button-text-button 
android:layout_below="@+id/rel_jobDesc" 
android:background="@drawable/job_match_bg" > 

</ListView> 

<TextView //this is the text the is between linear and list 
android:id="@+id/AboveLinear" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_above="@+id/linearLayout1" 
android:layout_centerHorizontal="true" 
android:text="Right here what ever you want" /> 

<LinearLayout // here what you care about 
android:id="@+id/linearLayout1" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_alignParentBottom="true" 
android:layout_centerHorizontal="true" 
> 

<Button 
    android:id="@+id/btn_more" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="0.5" 
    android:text="Left" /> 

<TextView 
    android:id="@+id/Left" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:text="TExt!!" 
    /> 

<Button 
    android:id="@+id/button1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="0.5" 
    android:text="Right" /> 

</LinearLayout> 

</RelativeLayout> 

это будет выглядеть следующим образом:

enter image description here

Рад, что смог помочь, Обратите внимание на ID я дал компоненты

+0

благодаря недоброжелателям переигровки, и это очень полезно, но мы также хотим, чтобы добавить еще один textiew в верхней части кнопки слева правой в центре –

+0

чека Редактировать ... – Coderji

+0

надежда это то, что вы хотите (отредактируйте часть) – Coderji

0

использовать это свойство для кнопки для

android:layout_alignBottom="@+id/list" 
Смежные вопросы