2016-02-17 28 views
0

如何在android jellybean(4.1.2)屏幕中完全滾動相對佈局? 當我們在這個(4.1.2)屏幕上運行時,佈局(按鈕imgv5)隱藏在底部。此外,滾動視圖正在工作,但不完全。你能幫我嗎?如何在jellybean(4.1.2)屏幕中的android中的相對佈局完全滾動?

<?xml version="1.0" encoding="utf-8"?> 
    <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" 
     > 

     <ScrollView 
       android:id="@+id/ScrollView01" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:fillViewport="true"   
       > 
       <!-- android:scrollbars="vertical" --> 
     <RelativeLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:layout_margin="10dp" 
       > 

       <EditText 
        android:id="@+id/edtName" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_alignParentTop="true" 
        android:layout_centerHorizontal="true" 
        android:hint="Enter Name" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000"/> 

       <EditText 
        android:id="@+id/edtMobile" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/edtName" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="5dp" 
        android:layout_centerHorizontal="true" 
        android:hint="Enter Mobile-Number" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000" 
        /> 


       <EditText 
        android:id="@+id/edtAddres" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/edtMobile" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="5dp" 
        android:layout_centerHorizontal="true" 
        android:hint="Enter Address" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000" 
        /> 

       <EditText 
        android:id="@+id/edtVehicleModel" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/edtAddres" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="5dp" 
        android:hint="Enter Vehicle-model" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000" 
        android:visibility="gone" 
        /> 

       <EditText 
        android:id="@+id/edtVehicleNo" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/edtVehicleModel" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="5dp" 
        android:hint="Enter Vehicle-number" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000" 
        /> 

       <EditText 
        android:id="@+id/edtServiceType" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:layout_below="@+id/edtVehicleNo" 
        android:layout_marginLeft="10dp" 
        android:layout_marginRight="10dp" 
        android:layout_marginTop="5dp" 
        android:hint="Enter Service-type" 
        style="@style/editText" 
        android:clickable="false" 
        android:cursorVisible="false" 
        android:focusable="false" 
        android:focusableInTouchMode="false" 
        android:textColor="#000000" 
        android:visibility="gone" 
        /> 


       <ImageView     
          android:id="@+id/imgV1" 
          android:layout_width="125dp" 
          android:layout_height="55dp" 
          android:clickable="true" 
          android:layout_marginTop="25dp" 
          android:layout_below="@+id/edtServiceType" 
          android:background="#2196F3" 
          android:scaleType="fitXY" 
          /> 

          <TextView 
          android:id="@+id/ImageViewText1" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignLeft="@+id/imgV1" 
          android:layout_alignTop="@+id/imgV1" 
          android:layout_alignRight="@+id/imgV1" 
          android:layout_alignBottom="@+id/imgV1" 
          android:layout_margin="1dp" 
          android:gravity="center" 
          android:text="Front View" 
          android:textColor="#ffffff" /> 

       <ImageView 
          android:id="@+id/imgV2" 
          android:layout_width="125dp" 
          android:layout_height="55dp" 
          android:clickable="true" 
          android:layout_marginTop="25dp" 
          android:layout_alignParentRight="true" 
          android:layout_alignParentEnd="true" 
          android:layout_alignBottom="@+id/imgV1" 
          android:background="#2196F3" 
          android:scaleType="fitXY"/> 

        <TextView 
          android:id="@+id/ImageViewText2" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignLeft="@+id/imgV2" 
          android:layout_alignTop="@+id/imgV2" 
          android:layout_alignRight="@+id/imgV2" 
          android:layout_alignBottom="@+id/imgV2" 
          android:layout_margin="1dp" 
          android:gravity="center" 
          android:text="Rear View" 
          android:textColor="#ffffff" /> 


        <ImageView 
          android:id="@+id/imgV3" 
          android:layout_width="125dp" 
          android:layout_height="55dp" 
          android:clickable="true" 
          android:layout_below="@+id/imgV1" 
          android:layout_marginTop="15dp" 
          android:background="#2196F3" 
          android:scaleType="fitXY" /> 

        <TextView 
          android:id="@+id/ImageViewText3" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignLeft="@+id/imgV3" 
          android:layout_alignTop="@+id/imgV3" 
          android:layout_alignRight="@+id/imgV3" 
          android:layout_alignBottom="@+id/imgV3" 
          android:layout_margin="1dp" 
          android:gravity="center" 
          android:text="Right View" 
          android:textColor="#ffffff" /> 


        <ImageView 
          android:id="@+id/imgV4" 
          android:layout_width="125dp" 
          android:layout_height="55dp" 
          android:clickable="true" 
          android:layout_marginTop="25dp" 
          android:layout_alignParentRight="true" 
           android:layout_alignParentEnd="true" 
          android:layout_alignBottom="@+id/imgV3" 
          android:background="#2196F3" 
          android:scaleType="fitXY"/> 

        <TextView 
          android:id="@+id/ImageViewText4" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignLeft="@+id/imgV4" 
          android:layout_alignTop="@+id/imgV4" 
          android:layout_alignRight="@+id/imgV4" 
          android:layout_alignBottom="@+id/imgV4" 
          android:layout_margin="1dp" 
          android:gravity="center" 
          android:text="Left View" 
          android:textColor="#ffffff" /> 


        <ImageView 
          android:id="@+id/imgV5" 
          android:layout_width="125dp" 
          android:layout_height="55dp" 
          android:clickable="true" 
          android:layout_below="@+id/imgV3"      
          android:layout_centerHorizontal="true" 
          android:layout_marginTop="10dp" 
          android:background="#2196F3" 
          android:gravity="center" 
          android:scaleType="fitXY" 
          /> 

          <!-- android:layout_marginLeft="125dp" --> 

        <TextView 
          android:id="@+id/ImageViewText5" 
          android:layout_width="wrap_content" 
          android:layout_height="wrap_content" 
          android:layout_alignLeft="@+id/imgV5" 
          android:layout_alignTop="@+id/imgV5" 
          android:layout_alignRight="@+id/imgV5" 
          android:layout_alignBottom="@+id/imgV5" 
          android:layout_margin="1dp" 
          android:gravity="center" 
          android:text="Job Sheet" 
          android:textColor="#ffffff" /> 

        <!-- <Button 
         android:id="@+id/btnCreateId" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_alignParentBottom="true" 
         android:layout_centerInParent="true" 
         android:layout_marginTop="20dp" 
         android:text="Create ID" 
         style="@style/button"/> --> 

     </RelativeLayout> 
     </ScrollView> 

      <Button 
         android:id="@+id/btnCreateId" 
         android:layout_width="match_parent" 
         android:layout_height="wrap_content" 
         android:layout_alignParentBottom="true" 
         android:layout_centerInParent="true" 
         android:layout_marginTop="20dp" 
         android:text="Create ID" 
         style="@style/enter code here button"/> 

    </RelativeLayout> 

回答

1

設置上面使用ImageViewText5 機器人的滾動視圖:layout_above

  <ScrollView 
      android:id="@+id/ScrollView01" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_above="@+id/ImageViewText5" 
      android:fillViewport="true"   
      > 
相關問題