【发布时间】:2013-01-16 09:13:10
【问题描述】:
我试图弄清楚如何将dashboardNewsItemDate 对齐到右侧,而不是左侧。目前它立即显示在dashboardNewsItemHeadline 旁边。我认为将它放在TableRow 中会使android:layout_gravity="right" 功能如我所愿,但事实证明这是错误的。
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:layout_gravity="center">
<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/dashboardNewsItemHeadline" android:layout_gravity="left"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="New Text"
android:id="@+id/dashboardNewsItemDate" android:layout_gravity="right" android:autoText="false"/>
</TableRow>
</TableLayout>
最后,我的目标是内容,所以要像这样显示......
My news title Mar 3
-----------------------------------------
This is a bit of a longer news Jul 2
title and it wraps
【问题讨论】:
标签: android