2016-09-19 7 views
0

Die Bildlaufansicht zeigt nicht den vollständigen Text. Es wird um ein paar Zeilen abgeschnitten. Ich möchte die Schaltfläche in scrollview nicht einschließen, sie sollte immer unten bleiben. Irgendeine Abhilfe für dieses?Android - Scrollen in 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

Fügen Sie ein 'layout_above'-Attribut für Ihre' ScrollView' mit der 'Button'-ID hinzu. Außerdem müssen Sie 'AppCompatButton' nicht wirklich selbst angeben. Sie können einfach normale 'Button' verwenden. Es wird während der Inflation gesorgt werden. –

Antwort

1

Ich habe android:layout_above="@+id/details_call_button in Scroll Tag und es scheint zu funktionieren.