我试过使用marquee,它不在这里工作是我的代码,请让我知道我哪里出错了
<TextView
android:text="lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00"
android:id="@+id/TextView02"
android:layout_width="200dip"
android:layout_height="wrap_content"
android:marqueeRepeatLimit="marquee_forever"
android:ellipsize="marquee"
android:singleLine="true"
android:focusable="true"
android:inputType="text"
android:maxLines="1">
</TextView>
Run Code Online (Sandbox Code Playgroud)
我正在使用android SDK 2.0.1
我需要实现以下布局:

我在相对布局中有两个TextView:绿色的是固定文本wrap_content,黑色有动态文本wrap_content.黑色文本可以更改并变得非常长.我希望黑色TextView随文本一起展开,直到绿色视图到达父级的末尾.如果发生这种情况,黑色TextView应该停止扩展并椭圆化结束.
我怎样才能做到这一点?
我尝试了什么:
<RelativeLayout
android:id="@+id/parent"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/leftTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:layout_alignParentLeft="true"
android:textSize="18sp" />
<TextView
android:id="@+id/rightTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/leftTextView"
android:textSize="18sp" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
但是当黑色文本越来越大时,它会将绿色文本推出视图
我的listview项目由三列和三行组成.我使用TableLayout.列之间的空间不统一但我通过设置margin来管理.现在布局看起来很完美.
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/dp18"
android:paddingLeft="@dimen/dp16"
android:paddingTop="@dimen/dp18"
android:stretchColumns="0,1,2">
<TableRow>
..
</TableRow>
<TableRow>
..
</TableRow>
<TableRow>
..
</TableRow>
</TableLayout>
Run Code Online (Sandbox Code Playgroud)
但我想知道什么是理想的方法?如果我使用了四个LinearLayout(一个外部水平线性布局和三个内部垂直线性布局用于三列),那么在优化和性能方面会有什么不同.当TableRow扩展LinearLayout然后间接我只使用LinearLayout.
那么,使用单个TableLayout而不是多个LinearLayout有什么好处,因为TableRow只扩展了LinearLayout?