2015-12-04 3 views
0

Это, вероятно, что-то действительно простое, но искаженное, если я могу решить.Масштабирование высоты фрагмента

Я пытаюсь создать страницу входа, похожую на Evernotes, используя макет с вкладками с регистрационными и регистрационными фрагментами (фиксированная высота textview верхняя половина экрана и логин/входные фрагменты внизу).

Однако фрагменты, как представляется, тот же размер, как родитель и TextView смещается вниз фрагмент и частично вне экрана, когда я т.е. использовать TextView с layout_alignParentBottom = «истина» это TextView выключен экран ?.

Любые идеи?

Heres мой макет XML:

Основная деятельность()

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

<android.support.design.widget.AppBarLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

     <include 
      android:id="@+id/toolbar" 
      layout="@layout/toolbar_login_signup" /> 

     <RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      android:id="@+id/main_layout" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent"> 

     <TextView 
      android:id="@+id/iv_test" 
      android:layout_width="match_parent" 
      android:layout_height="100dp" 
      android:text="Feature Graphic Here!" 
      android:textSize="30sp" 
      android:gravity="center" 
      android:layout_alignParentTop="true"/> 

     <android.support.design.widget.TabLayout 
      android:id="@+id/tabs" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@+id/iv_test" 
      app:tabMode="fixed" 
      app:tabGravity="fill"/> 

     </RelativeLayout> 

    </android.support.design.widget.AppBarLayout> 

<android.support.v4.view.ViewPager 
    android:id="@+id/viewpager" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" /> 


</android.support.design.widget.CoordinatorLayout> 

И мой Войти макет фрагмент:

<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" 
tools:context="activity.LoginFragment"> 

<!-- TODO: Update blank fragment layout --> 
<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Top" 
    android:textSize="40dp" 
    android:textStyle="bold" 
    android:layout_alignParentTop="true"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="@string/action_login" 
    android:textSize="40dp" 
    android:textStyle="bold" 
    android:layout_centerInParent="true"/> 

<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Bottom"<-- this is pushed down off screen--> 
    android:textSize="40dp" 
    android:textStyle="bold" 
    android:layout_alignParentBottom="true"/> 

ответ

0

Решенный, просмотр пейджера должен был находиться внутри корпуса appbarlayout! работая в обаянии.

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