2015-12-04 40 views
0

這可能是一些真正簡單的事情,但如果我可以解決,就會發生錯誤。縮放片段高度

我試圖創建一個登錄頁面類似於Evernotes使用登錄和註冊碎片(固定高度textview上半部分屏幕和登錄/登錄碎片下半部分)的選項卡式佈局。

然而片段似乎是大小相同的父和TextView的被向下和部分離屏即移位片段,當我使用一個TextView與layout_alignParentBottom =「真」這TextView的是關閉屏幕?

任何想法?

繼承人我佈局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體內!現在工作的魅力。