У меня проблема с чем-то, что «должно» работать, но это просто не так.TextView не сглаживает линию правильно
TextView
внутри TableRow
не обеспечивает разрыв строки, где он должен, вместо этого же TextView
имеет ту же ширину, как TableRow
, не обращая внимания, что один TextView
уже есть и принимая какое-то пространство.
Вот пример:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical"
android:weightSum="1" >
<ScrollView
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.4"
android:scrollbars="vertical" >
<TableLayout
android:id="@+id/tableAtTest"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow
android:id="@+id/firstContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:gravity="center_vertical"
android:text="first description"
android:textColor="#000000"
android:textSize="@dimen/smallSize"
android:textStyle="bold" />
<TextView
android:id="@+id/firstText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:text="test test test test test test test test test test test test test test test test test test test test test test "
android:textColor="#000000"
android:textSize="@dimen/smallSize" />
</TableRow>
<TableRow
android:id="@+id/secondContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="2dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:gravity="center_vertical"
android:text="second description"
android:textColor="#000000"
android:textSize="@dimen/smallSize"
android:textStyle="bold" />
<TextView
android:id="@+id/secondText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:text="test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 test2 "
android:textColor="#000000"
android:textSize="@dimen/smallSize" />
</TableRow>
</TableLayout>
</ScrollView>
<android.support.v4.view.ViewPager
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/pagerOnTest"
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="0.6"
tools:context=".TestActivity" >
</android.support.v4.view.ViewPager>
</LinearLayout>
</RelativeLayout>
Если вы посмотрите на ширину полей, принятых @id/firstText
и @id/secondText
вы увидите, что правая сторона TextView
находится за пределами экрана.
Любая помощь будет оценена по этому поводу. Благодаря!
вам не нужно использовать новую строку, просто отформатируйте текстовые изображения в соответствии с моим ответом. –