1
我想滾動Xamarin(android)textview內容。但是,到目前爲止,沒有工作如何我的預期。我嘗試在scrollview中包裝textview,但也沒有工作。出於某種原因,帶有@ + id/ttext的textview會在添加更多行時推送其他元素。Xamarin不能滾動textview
<?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>
當你說「我想滾動Xamarin(android)textview」你的意思是你試圖滾動的TextView的內容? – apineda
是的,我想滾動textview的內容 –
如果你指定android:maxLines =「10」和android:layout_height =「match_parent」,你期望它做什麼? –