2016-09-19 71 views
0

滾動視圖不顯示全文。它被幾條線切斷。 我不想在scrollview中包含按鈕,它應該始終停留在底部。任何解決方法?Android - 在RelativeLayout中滾動

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="#ffffff"> 

    <ScrollView 
     android:id="@+id/details_view" 
     android:layout_width="match_parent" 
     android:fillViewport="true" 
     android:layout_height="wrap_content"> 

     <RelativeLayout 
      android:id="@+id/details_layout" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical" 
      android:paddingTop="@dimen/activity_vertical_margin"> 

      <ImageView 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:id="@+id/provider_logo" /> 

      <TextView 
       android:paddingLeft="@dimen/activity_horizontal_margin" 
       android:paddingRight="@dimen/activity_horizontal_margin" 
       android:id="@+id/details_title" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:textSize="18sp" 
       android:layout_below="@id/provider_logo" 
       android:textStyle="bold" 
       android:layout_marginTop="10dp" 
       android:textColor="@color/colorPrimary"/> 


      <TextView 
       android:id="@+id/details_description" 
       android:layout_below="@id/details_heading" 
       android:singleLine="false" 
       android:lineSpacingMultiplier="1.3" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:paddingLeft="@dimen/activity_horizontal_margin" 
       android:paddingRight="@dimen/activity_horizontal_margin" 
       android:textSize="16sp" 
       android:text="Lorem Ipsum is simply dummy text of the printing and Lorem Ipsum is simply dummy text of the printing and Lorem Ipsum is simply dummy text of the printing and Lorem Ipsum is simply dummy text of the printing and Lorem Ipsum is simply dummy text of the printing andLorem Ipsum is simply dummy text of the printing andLorem Ipsum is simply dummy text of the printing and" 
       android:layout_marginTop="10dp" 
       android:textColor="@color/text_grey"/> 

     </RelativeLayout> 

    </ScrollView> 

    <android.support.v7.widget.AppCompatButton 
     android:id="@+id/details_call_button" 
     style="?android:textAppearanceSmall" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:textStyle="bold" 
     android:background="@color/colorPrimary" 
     android:textColor="@color/white" 
     android:layout_alignParentBottom="true" 
     /> 

</RelativeLayout> 
+0

在'ScrollView'上用'Button'的ID添加'layout_above'屬性。另外,你並不需要自己指定'AppCompatButton'。你可以使用普通的'Button'。在通貨膨脹期間它會被照顧。 –

回答

1

滾動型標籤添加android:layout_above="@+id/details_call_button,它似乎工作。

相關問題