xml如下,需求是,message_resend_ll这个button显示在msginfo的右侧。msginfo是输入的信息,内容不定。
如果发送信息不成功,message_resend_ll则显示出来,一般情况就隐藏。message_resend_ll不显示的时候,手机屏幕上会有58dip的位置空着,保证信息内容足够长的时候,手机屏幕上右对齐,与接收到的信息保持层次感。[color=#FF9900]问题:当xml为以下布局时,信息内容会将button的位置挤到屏幕外面,即button不能显示在屏幕上[/color]如果将message_resend_ll放在button的右边,依旧是下面的xml,只是将两个控件的位置更换,可以完全显示在屏幕上?求大侠帮忙解决?
<com.android.mms.ui.MessageListItem
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/msg_list_item_send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dip"
android:background="@drawable/background_transparent"
android:orientation="horizontal"
android:descendantFocusability="blocksDescendants"> <LinearLayout android:id="@+id/mms_layout_view_super_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/listitem_background"
android:orientation="horizontal" >
<TextView android:id="@+id/msginfo"
android:autoLink="all"
android:paddingBottom="0dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:linksClickable="false"
android:gravity="left"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/message_resend_ll"
android:layout_width="58dip"
android:layout_height="fill_parent">
<ImageButton
android:id="@+id/message_resend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/resend_btn_selector"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:focusable="true"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
</com.android.mms.ui.MessageListItem>
如果发送信息不成功,message_resend_ll则显示出来,一般情况就隐藏。message_resend_ll不显示的时候,手机屏幕上会有58dip的位置空着,保证信息内容足够长的时候,手机屏幕上右对齐,与接收到的信息保持层次感。[color=#FF9900]问题:当xml为以下布局时,信息内容会将button的位置挤到屏幕外面,即button不能显示在屏幕上[/color]如果将message_resend_ll放在button的右边,依旧是下面的xml,只是将两个控件的位置更换,可以完全显示在屏幕上?求大侠帮忙解决?
<com.android.mms.ui.MessageListItem
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/msg_list_item_send"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="1dip"
android:background="@drawable/background_transparent"
android:orientation="horizontal"
android:descendantFocusability="blocksDescendants"> <LinearLayout android:id="@+id/mms_layout_view_super_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/listitem_background"
android:orientation="horizontal" >
<TextView android:id="@+id/msginfo"
android:autoLink="all"
android:paddingBottom="0dip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:linksClickable="false"
android:gravity="left"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="#000000"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/message_resend_ll"
android:layout_width="58dip"
android:layout_height="fill_parent">
<ImageButton
android:id="@+id/message_resend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/resend_btn_selector"
android:layout_gravity="center_vertical"
android:layout_marginLeft="10dip"
android:layout_marginRight="10dip"
android:focusable="true"
android:visibility="gone"/>
</LinearLayout>
</LinearLayout>
</com.android.mms.ui.MessageListItem>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货