当前位置: 代码迷 >> Android >> !一个对齐的有关问题
  详细解决方案

!一个对齐的有关问题

热度:54   发布时间:2016-04-28 03:45:01.0
求助!一个对齐的问题!
我想问下 如何能让描述和日期在同一行里显示 
   
<RelativeLayout>
 <TextView
        android:id="@+id/tvContent"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:maxLines="2"
        android:layout_alignLeft="@id/tvTitle"
        android:layout_below="@id/tvTitle"
        android:textSize="14sp"
        android:textColor="#8A8A8A" />
    
    <TextView
        android:id="@+id/tvReview"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_toLeftOf="@id/tvContent"
        android:textSize="14sp"
        android:textColor="#CCCCCC" />
</RelativeLayout>

  
------解决思路----------------------
把日期和内容写在同一个TextView,而不是两个TextView。然后给日期加span来实现不同的字体/颜色
------解决思路----------------------
相对布局里边,日期的textview 底部和 你描述的textview的底部  对齐
  相关解决方案