2017-02-22 8 views
-2

Android Studioで新しいタブ付きアクティビティプロジェクトを開始しました。フラグメントの内容に最後のコントロールのシリアル番号は表示されません。フラグメントのXMLAndroid ScrollViewでフラグメントの下部コンテンツが表示されない

<FrameLayout 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="com.example.ibrahimnehme.slidingtab.StockTakeFragment"> 

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent"> 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     android:orientation="vertical" 
     android:padding="5dp"> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/part_number" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Part Number" 
       android:inputType="text" 
       android:maxLines="1" 
       android:singleLine="true" /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/part_description" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Part Description" 
       android:inputType="textMultiLine" 
       android:maxLines="3" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:text="@string/lotId" 
      style="@style/InputLabel" /> 

      <Spinner 
       android:id="@+id/LotId" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:prompt="@string/lotId" 
       android:spinnerMode="dialog" 
       android:padding="5dp" 
       style="@style/Widget.AppCompat.Spinner.Underlined" 
       android:layout_gravity="bottom"/> 

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

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/Location" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Location" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/SubLocation" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Sub Location" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/nsn" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="NSN" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/Unit_Of_Measurement" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Unit Of Measurement (UoM)" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/ControlId" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Control Id" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/Ext_Trace_Id" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Ext Trace Id" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/ExpiryDate" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Expiry Date" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/Status" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Status" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 

     <android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:paddingBottom="20dp" 
      android:layout_height="wrap_content"> 

      <AutoCompleteTextView 
       android:id="@+id/Serial_Number" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:hint="Serial Number" 
       android:inputType="text" 
       android:maxLines="1" 
       /> 
     </android.support.design.widget.TextInputLayout> 
    </LinearLayout> 
</ScrollView> 

の下には、最後の目に見えるコントロールは、 'ステータス' です。私はPadBottom = "20dp"にしようとしたが、ScrollViewをRelativeLayoutでラップするが、同じ問題が残っている。

最小SDK API 23 Android 6

ご協力いただきありがとうございます。おかげ

答えて

1

アンドロイドを追加する別のXMLファイルにあなたのフラグメントの内容を定義してから、フラグメントxmlファイルに含めると

に代わり
<FrameLayout 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="com.example.ibrahimnehme.slidingtab.StockTakeFragment"> 

    <android.support.v4.widget.NestedScrollView 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

    <include layout="@layout/yourOtherXMLFile"/> 

    </android.support.v4.widget.NestedScrollView> 
</FrameLayout> 
0

thet android.support.design.widget.TextInputLayout

<android.support.design.widget.TextInputLayout 
 
      android:layout_width="match_parent" 
 
      android:paddingBottom="20dp" 
 
      android:layout_height="wrap_content"> 
 

 
      <AutoCompleteTextView 
 
       android:id="@+id/Serial_Number" 
 
       android:layout_width="match_parent" 
 
       android:layout_height="wrap_content" 
 
       android:hint="Serial Number" 
 
       android:inputType="text" 
 
       android:maxLines="1" 
 
       />

アンドロイドを削除するには、あなたがパディングを削除します。paddingBottomの= "20dp"

+0

をNestedScrollViewを使用します。marginBottom =「20dp」thetはあなたを助けるでしょう –

0

はそうandroid:fillViewPort="true" を追加します。

になります

<FrameLayout 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="com.example.ibrahimnehme.slidingtab.StockTakeFragment"> 

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" 
    android:fillViewPort="true"> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" 
      android:orientation="vertical" 
      android:padding="5dp"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/part_number" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Part Number" 
        android:inputType="text" 
        android:maxLines="1" 
        android:singleLine="true" /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/part_description" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Part Description" 
        android:inputType="textMultiLine" 
        android:maxLines="3" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

      <TextView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:text="@string/lotId" 
       style="@style/InputLabel" /> 

       <Spinner 
        android:id="@+id/LotId" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_weight="1" 
        android:prompt="@string/lotId" 
        android:spinnerMode="dialog" 
        android:padding="5dp" 
        style="@style/Widget.AppCompat.Spinner.Underlined" 
        android:layout_gravity="bottom"/> 

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

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/Location" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Location" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/SubLocation" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Sub Location" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/nsn" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="NSN" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/Unit_Of_Measurement" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Unit Of Measurement (UoM)" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/ControlId" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Control Id" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/Ext_Trace_Id" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Ext Trace Id" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/ExpiryDate" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Expiry Date" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/Status" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Status" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:paddingBottom="20dp" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/Serial_Number" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="Serial Number" 
        android:inputType="text" 
        android:maxLines="1" 
        /> 
      </android.support.design.widget.TextInputLayout> 
     </LinearLayout> 
    </ScrollView> 

私は同じ問題がありました。 fillViewPortを追加すると、スクロールビューが表示されます。

関連する問題