2017-02-14 1 views
1

Ich versuche, Xamarin (Android) Textansicht Inhalte scrollen.Allerdings, soweit das nicht funktioniert, wie ich erwartet habe. Ich habe versucht, Textansicht in Scrollview zu umbrechen, aber das hat auch nicht funktioniert. Aus irgendeinem Grund schiebt Textview mit @ + id/ttext andere Elemente, während ich weitere Zeilen hinzufüge.Xamarin kann nicht scrollen Textansicht

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/mainBack" 
    android:background="@drawable/lightblue" 
    android:weightSum="3"> 
    <LinearLayout 
     android:orientation="horizontal" 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/linearLayout1" 
     android:layout_weight="1" 
     android:gravity="center"> 
     <Button 
      android:text="Start Recording" 
      android:textSize="13dp" 
      android:layout_width="110.0dp" 
      android:layout_height="64.0dp" 
      android:id="@+id/btnRecord" 
      android:width="150dp" 
      android:height="120dp" 
      android:shadowColor="#ffababab" 
      android:layout_marginBottom="0.0dp" 
      android:layout_marginTop="0.0dp" 
      android:layout_marginRight="0.0dp" 
      android:layout_marginLeft="0.0dp" /> 
    </LinearLayout> 
    <LinearLayout 
     android:orientation="vertical" 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/linearLayout2" 
     android:layout_weight="1"> 
     <TextView 
      android:text="MyNote:" 
      android:textAppearance="?android:attr/textAppearanceLarge" 
      android:layout_width="match_parent" 
      android:layout_height="82.0dp" 
      android:id="@+id/textView1" 
      android:layout_marginLeft="5dp" /> 
     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:id="@+id/ttext" 
      android:textColor="#ffedf01d" 
      android:maxLines = "10" 
      android:scrollbars = "vertical" 
      android:layout_marginLeft="5dp" 
      android:layout_marginRight="5dp" /> 
    </LinearLayout> 
    <LinearLayout 
     android:orientation="horizontal" 
     android:minWidth="25px" 
     android:minHeight="25px" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:id="@+id/linearLayout3" 
     android:layout_weight="1" /> 
</LinearLayout> 
+0

Wenn Sie sagen: „Ich versuche, Xamarin (android) Textview zu blättern“ Sie meinen, Sie versuchen, zu bewegen, den Inhalt des Textview? – apineda

+0

Ja, ich versuche den Inhalt der Textansicht zu scrollen –

+0

was erwartest du, wenn du android: maxLines = "10" und android: layout_height = "match_parent" angegeben hast? –

Antwort

1

in der XML-Suche kann ich Ihr Problem sehen ist, weil für Ihre ttextTextview die layout_height als „match_parent“ gesetzt ist. Ändern Sie dies in "wrap_content" und die TextView wird nur so viel wie die maxLines wachsen, in Ihrem Fall wird es bis zu der Größe von 10 Zeilen wachsen.