我一直在試圖開發一個包含可滾動活動 和活動內部的android應用程序,我有2個textView,我希望它們也可以滾動。Android textView滾動
我的問題是 每當我接觸到的TextView的滾動顯示出來,但它是LinearLayout中直接鋼的焦點,不再TextView的滾動
我有辦法的主要活動部分內,現在是建立爲textView滾動XML文件我已經做到了。 如果我不斷舉起手指並將其放回屏幕上,試圖滾動textView,我可以移動一點,但正如我所說的,包含textView的佈局捕捉焦點並讓我無法滾動textView。
我希望我很好地解釋了我的問題。
請有任何建議來幫助。
讓我解釋應用程序是如何構建的第一 第一部分是:主(第一)活動是tabHost 我定義爲滾動
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="422dp" >
</FrameLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="63dp" >
</TabWidget>
</LinearLayout>
</ScrollView>
</TabHost>
在那裏我有問題是本次活動
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@color/light_gray_color"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:weightSum="1"
android:orientation="vertical"
android:baselineAligned="false">
<LinearLayout
android:id="@+id/linearLayout3"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.04">
<TextView
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textColor="@color/black_color"
android:layout_gravity="center_horizontal"
android:text="@string/display_label"
android:id="@+id/display_label">
</TextView>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="0.83"
android:baselineAligned="false"
android:orientation="horizontal" >
<ScrollView
android:id="@+id/english_scrollView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.03" >
<TextView
android:id="@+id/display_english_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2px"
android:layout_marginRight="2px"
android:layout_weight="0.03"
android:background="@drawable/black_rectangle"
android:focusable="true"
android:paddingLeft="2px"
android:paddingRight="2px"
android:scrollbars="vertical"
android:textColor="@color/black_color" />
</ScrollView>
<ScrollView
android:id="@+id/translation_scrollView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.03" >
<TextView
android:id="@+id/display_translation_textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2px"
android:layout_marginRight="2px"
android:layout_weight="0.03"
android:background="@drawable/black_rectangle"
android:focusable="true"
android:paddingLeft="2px"
android:paddingRight="2px"
android:scrollbars="vertical"
android:textColor="@color/black_color" />
</ScrollView>
</LinearLayout>
</LinearLayout>
能否請您添加的代碼,然後我們可以看到怎麼回事,謝謝。 – FabianCook 2012-02-10 00:05:43