Android добавляет вид со стороны Java

1

Мой xml:

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

  <View         
    android:layout_width="fill_parent"         
    android:layout_height="3dp"         
    android:paddingTop="20dp"         
    android:background="#000088" />


  <RelativeLayout  
        android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:orientation="horizontal">   


  <TextView
     android:id="@+id/employeename"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:textSize="11pt"
     android:padding="5dip"
     android:textStyle="bold"
     android:textColor="#000033"
     android:layout_marginTop="10dip"
     android:layout_marginBottom="10dip"
     android:layout_alignParentLeft="true"
        />

 <TextView
     android:id="@+id/employeestn"
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:textSize="11pt"
     android:padding="5dip"
     android:textStyle="bold"
     android:textColor="#000033"
     android:layout_marginTop="10dip"
     android:layout_marginBottom="10dip"
     android:text ="TUL"
     android:layout_alignParentRight="true"
        />

 </RelativeLayout>
<ListView 
     android:id="@+id/mytasklist"
     android:layout_weight="1"
     android:divider="#B2B0BF"
     android:dividerHeight="10px"
     android:background="#FFFFFF"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
 />

</LinearLayout>

У меня есть два текстовых комментария и список. Я могу или не могу иметь другой список в зависимости от данных. Моя страница может иметь максимум 3 вида списка. Можно ли добавить другой список из java-стороны? Как? -------------------------------------------------- ---------------------------------

Ценить помощь

  • 0
    почему -1? Что не так с моим вопросом
Теги:

1 ответ

0

Вы можете определить третий ListView в своем XML и сделать его изначально невидимым в вашем XML. Затем в зависимости от ваших данных вы можете заполнить его и сделать его видимым.

  • 0
    О хорошо Благодарю. Я попытаюсь.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню