实现类似QQ、微信聊天界面,标题栏固定,键盘不遮挡底部输入框
2016-03-14 18:50
791 查看
1.AndroidManifest.xml里面对应的activity设置
android:windowSoftInputMode="adjustResize" 2.activity的xml a.根节点加入android:fitsSystemWindows="true" b.为了更好的效果listview加入 android:transcriptMode="normal"
<?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" android:fitsSystemWindows="true" android:orientation="vertical"> <include android:id="@+id/v_top" layout="@layout/title_layout_for_edittext" /> <LinearLayout android:id="@+id/ll_bottom" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="vertical"> <View android:layout_width="match_parent" android:layout_height="@dimen/space_05" android:layout_alignParentTop="true" android:background="@color/line_Color" /> <RelativeLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginBottom="@dimen/space_6" android:layout_marginLeft="@dimen/activity_horizontal_margin" android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginTop="@dimen/space_6"> <Button android:id="@+id/btn_send" android:layout_width="@dimen/space_75" android:layout_height="@dimen/space_38" android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginLeft="@dimen/space_6" android:background="@drawable/round_corner_rectangle_small" android:gravity="center" android:text="发送" android:textColor="@color/white" android:textSize="@dimen/text_size_20" /> <EditText android:id="@+id/et_edit_message" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" android:layout_toLeftOf="@+id/btn_send" android:background="@drawable/chat_edit_view_bg" android:maxHeight="@dimen/space_90" android:minHeight="@dimen/space_40" android:padding="@dimen/space_6" android:text="" android:textColor="@color/text_black_3" android:textSize="@dimen/text_size_16" /> </RelativeLayout> </LinearLayout> <ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_above="@+id/ll_bottom" android:layout_below="@+id/v_top" android:divider="@null" android:dividerHeight="0dip" android:transcriptMode="normal" /> </RelativeLayout>
相关文章推荐
- iOS微信登录的坑,unionid打通
- 盟聚解说微信朋友圈广告营销
- java微信开发-OAuth2.0授权
- 微信开发入门-2
- 微信开发入门-1
- java微信开发-消息接收和自动回复
- 配置环境代码,微信分享代码
- js判断当前环境是否是微信内浏览器
- 微信内支付 微信jsapi之前台js部分
- java微信开发-token验证
- [Android]实现类似微信的延迟加载的Fragment——LazyFragment
- 支付介绍
- 45、微信-从通讯录添加好友
- 43、微信-好友详情页面FriendMsgActivity
- 友盟分享——微信、腾讯微博、新浪微博分享失败原因分析
- 42、微信-添加新朋友列表适配器
- 41、微信-添加新朋友NewFriendsListActivity
- 40、微信-搜索好友及公众号页面SearchActivity
- atitit。浏览器缓存机制 and 微信浏览器防止缓存的设计 attilax 总结
- js微信中判断浏览器