私のアプリでレイアウトに問題があります。 TextViewのテキストを(動的に)いくつかの長いテキストに変更した後、それは私のTableLayoutをオーバーレイします。 TableLayoutを可視範囲に移動する方法を決定するのを手伝ってくれることを願っています。動的に変更した後に別のレイアウトをオーバーレイするレイアウト
UPD。私の悪い、私はどのTextViewを変更したのか定義されていない。これは、id = textViewのTableLayoutの上にあるTextViewです。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.home.myapp1.MainActivity"
android:orientation="vertical">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="vertical"
android:text="Hello world!"
android:singleLine="false"/>
<TableLayout android:layout_marginTop="10dp"
android:id="@+id/table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="*">
<TableRow android:padding="5dp">
<TextView android:text="Валюта" android:gravity="center_horizontal"/>
<TextView android:text="Покупка" android:gravity="center_horizontal"/>
<TextView android:text="Продажа" android:gravity="center_horizontal"/>
</TableRow>
</TableLayout>
</LinearLayout>
私はのTextViewのMAXLINESを制限する必要はありませんTableLayout –
上のTextViewを変更しています、その逆は私が全体のテキストを表示する必要がありますTextViewが、1行を超えるたびに、下のビューがオーバーレイされるので、このオーバーレイされたビューをアクティビティの可視範囲に移動するソリューションが必要です。 –
あなたはアンドロイドを取ることができます:maxLength = "20"最大行の代わりに範囲を修正してください –