2013-07-22 4 views
0

я тусклый ОТТ создать sccreen как этим образом http://imgur.com/UVKCZdu моего экрана URL является looklike это http://imgur.com/gLQw4iV моего экрана не регулируйте facebook твиттер iccon также показать место на дне ниже 3 кнопки как я фиксированные их? помочь мне ниже мой XML-кодкак установить TextView с изображением в LinearLayout

  <?xml version="1.0" encoding="UTF-8"?> 


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#ffffff" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:background="#C0C0C0" > 

     <ImageView 
      android:id="@+id/test_button_image" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentTop="true" 
      android:paddingTop="5dp" 
      android:src="@drawable/icon" > 
     </ImageView> 

     <TextView 
      android:id="@+id/test_button_text2" 
      android:layout_width="wrap_content" 
      android:paddingTop="10dp" 
      android:layout_height="wrap_content" 
      android:layout_alignTop="@+id/test_button_image" 
      android:paddingLeft="10dp" 
      android:layout_toRightOf="@+id/test_button_image" 
      android:text="San Diego Unified" 
      android:textColor="#000000" 
      android:textSize="20sp" > 
     </TextView> 

     <TextView 
      android:id="@+id/test_button_text1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
       android:paddingLeft="10dp" 
      android:layout_alignLeft="@+id/test_button_text2" 
      android:layout_below="@+id/test_button_text2" 
      android:paddingBottom="10dp" 
      android:text="SCHOOL DISTRICT" 
      android:textColor="#000000" > 
     </TextView> 
    </RelativeLayout> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="40dp" 
     a 
     android:orientation="horizontal" > 

     <TextView 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_gravity="left|center_vertical" 
      android:layout_weight="1" 
      android:ellipsize="end" 
      android:gravity="left|center_vertical" 
      android:singleLine="true" 
      android:text="HEALTHY BODIES HEALTHY MINDS " 
      android:textColor="#000000" 
      android:textSize="12sp" /> 

     <ImageButton 
      android:id="@+id/button" 
      android:layout_width="wrap_content" 
      android:layout_height="40dp" 
      android:src="@drawable/facebook" /> 

     <ImageButton 
      android:id="@+id/button" 
      android:layout_width="wrap_content" 
      android:layout_height="40dp" 
      android:src="@drawable/twitter" 
      android:text="Button Text" /> 
    </LinearLayout> 
    <RelativeLayout 
     android:layout_marginTop="10dp" 

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

<EditText 
    android:id="@+id/editText1" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:hint="Search School By Name" 
    android:layout_centerVertical="true" > 

</EditText> 
<ImageView 
    android:id="@+id/imageView1" 
    android:padding="5dp" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignTop="@+id/editText1" 
    android:layout_alignBottom="@+id/editText1" 
    android:layout_alignRight="@+id/editText1" 
    android:src="@drawable/title_search" /> 

</RelativeLayout> 

    <TextView 
      android:id="@+id/txtCaption" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
     android:background="#ffffff" 
      android:paddingBottom="3dp" 
      android:paddingLeft="10dp" 
      android:paddingTop="3dp" 
      android:text="SELECT A SCHOOL TO VIEW LUNCH OR BREAKFAST MENUS" 
      android:textColor="#000000" 
      android:textSize="10sp" 
      android:textStyle="bold" /> 
    <View 
     android:layout_width="fill_parent" 
     android:layout_height="1dp" 
     android:background="#000000" /> 

    <LinearLayout 
     android:id="@+id/lytContent" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_above="@+id/txtCopyright" 

     android:background="#ffffff" 
     android:layout_below="@+id/lytTitlebar" 
     android:orientation="vertical" > 



     <ListView 
      android:id="@+id/listMainMenu" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:divider="@color/background" 
      android:dividerHeight="1dip" 
      android:fadeScrollbars="true" /> 
    </LinearLayout> 
    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:orientation="vertical" 

     android:background="#a8a8a8" 
     > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:background="#a8a8a8" 
     android:orientation="horizontal" > 

     <Button 
      android:id="@+id/button1" 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.333" 
      android:background="@drawable/button_style" 
      android:text="FARM TO SCHOOL" 
      android:textColor="@color/text" 
      android:textSize="8sp" 
      android:textStyle="bold" /> 

     <Button 
      android:id="@+id/button2" 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.333" 
      android:background="@drawable/button_style" 
      android:text="TAKE A SURVEY" 
      android:textColor="@color/text" 
      android:textSize="8sp" 
      android:textStyle="bold" /> 

     <Button 
      android:id="@+id/button3" 
      android:layout_width="0dp" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.333" 
      android:background="@drawable/button_style" 
      android:text="SHARE THIS APP" 
      android:textColor="@color/text" 
      android:textSize="8sp" 
      android:textStyle="bold" /> 
    </LinearLayout> 
    </LinearLayout> 
    </LinearLayout> 
+0

жаль это образец экрана http://imgur.com/UVKCZdu – user2589245

ответ

0

Вы не setText в ImageView может .. это только для TextViews

Что вы можете сделать вместо этого обернуть ImageView и TextView внутри FrameLayout, то сделать ваш setText на TextView. Убедитесь, что вы сначала определили ImageView, поэтому он находится ниже z-порядка TextView.

+0

увидеть этот экран http://imgur.com/UVKCZdu – user2589245

+0

я Вана сделать экран, как этот мой экран notlooklike это маги facebook твиттер не также настроить это шоу-пространство после трех кнопок, я хочу, чтобы выровнять нижнюю часть низа экрана – user2589245

0

Добавить изображение в текст представление, как это:

 <TextView 
      android:layout_width="0dp" 
      android:layout_height="fill_parent" 
      android:layout_weight="1" 
      android:drawableRight="@drawable/protection_unprotected" 
      android:gravity="center_vertical" 
      android:paddingRight="5dp" 
      android:text="@string/protection_unprotected" 
      android:textSize="18sp" 
      android:textStyle="bold" /> 

андроид: drawableRight = "@ вытяжке/protection_unprotected"

+0

как удалить пространство ниже трех кнопок? – user2589245

+0

android: paddingBottom = "0dip" or orroid: marginBottom = "0dip" –

+0

этот код добавить одно изображение справа как добавить 2 изображения справа? – user2589245

0

Для ваших кнопок Facebook и Twitter вы можете добавить

android:background = "@null" 

внутри ImageButton теги для нежелательного фона в кнопках.

+0

Как удалить пространство ниже трех кнопок? – user2589245

+0

помогает мне ур код, но обе кнопки близки друг другу i jjut написать одну строку android: background = "@null" – user2589245

0
<LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:layout_weight="1" 
     android:background="#a8a8a8" 
     android:orientation="horizontal" > 

<RelativeLayout 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:id="@+id/headerLinearLay" 
    android:orientation="horizontal"> 
    <ImageView 
     android:id="@+id/avatarImageView" 
     android:src="@drawable/icon" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content"></ImageView> 
    <TextView 
     android:id="@+id/usernameTextView" 
     android:text="TextView" 
     android:paddingLeft="4dp" 
     android:layout_toRightOf="@id/avatarImageView" 
     android:layout_centerVertical="true" 
     android:layout_height="wrap_content" 
     android:layout_width="wrap_content"></TextView> 
</RelativeLayout> 
</LinearLayout> 
Смежные вопросы