<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_gravity="bottom" android:background="@android:color/white" android:orientation="vertical" android:paddingLeft="10dp" android:paddingRight="10dp"> <EditText android:id="@+id/et_comment" android:layout_width="match_parent" android:layout_height="150dp" android:layout_marginTop="15dp" android:background="#f0f0f0" android:focusable="true" android:focusableInTouchMode="true" android:gravity="left|top" android:hint="我來說一說~" android:paddingBottom="5dp" android:paddingLeft="8dp" android:paddingRight="8dp" android:paddingTop="5dp" android:textSize="14dp" /> <Button android:textColor="@android:color/white" android:background="@android:color/holo_blue_light" android:id="@+id/btn_submit" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:layout_marginBottom="10dp" android:layout_marginTop="10dp" android:padding="5dp" android:text="發表評論" android:textSize="16sp" /> </LinearLayout> </LinearLayout>
<!--可输入对话框的样式 --> <style name="EditDialogStyle" parent="Theme.AppCompat.Light.NoActionBar"> //设置背景 <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowSoftInputMode">adjustResize|stateHidden</item> //Dialog的windowFrame框为无 <item name="android:windowFrame">@null</item> //是否显示标题,true则去掉默认的标题栏 <item name="android:windowNoTitle">true</item> //是否浮现在activity之上,false的话会被软键盘覆盖 <item name="android:windowIsFloating">true</item> //是否半透明,为false时背景为黑色不透明 <item name="android:windowIsTranslucent">true</item> //是否有覆盖 <item name="android:windowContentOverlay">@null</item> //Activity的动画效果 <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item> //背景是否模糊显示,为false时效果为全透明 <item name="android:backgroundDimEnabled">true</item> //点击空白处时是否销毁Activity <item name="android:windowCloseOnTouchOutside">true</item> </style>
<activity android:name=".DialogActivity" android:configChanges="orientation|screenSize" android:screenOrientation="portrait" android:theme="@style/EditDialogStyle"/>
InputMethodManager inputManager =(InputMethodManager)etComment.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.showSoftInput(etComment, 0);
new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
InputMethodManager inputManager =
(InputMethodManager) etComment.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputManager.showSoftInput(etComment, 0);
return false;
}
}).sendEmptyMessageDelayed(0, 300);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有