2012-02-19 2 views
0

Ниже приведен мой файл макета. Он отлично работает, за исключением того, что когда я включаю как foofragment, так и foo_pager, только один из них показывает показ (на основе которого вы добавляете первый, в следующем случае отображается только foofragment, но не foo_pager). Что мне здесь не хватает?Отображение фрагмента + просмотрщик в том же макете; один не отображается

<?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:id="@+id/linearLayout1" 
     android:layout_column="0" 
     android:layout_gravity="fill_horizontal" 
     android:layout_row="0" 
     android:orientation="vertical" > 

     <Button 
      android:id="@+id/button2" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Button" /> 

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

     <fragment class="view.foofragment" 
      android:id="@+id/foo_frag" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 

    <android.support.v4.view.ViewPager 
     android:id="@+id/foo_pager" 
      android:layout_width="match_parent" 
      android:layout_weight="1" 
      android:layout_height="wrap_content" /> 

    </LinearLayout> 

ответ

0

Я играл с layout_weight немного, и теперь он исправлен. Спасибо, что посмотрели.

Смежные вопросы