自定义对话框
来源:互联网 发布:火炬之光2mac中文版 编辑:程序博客网 时间:2024/05/04 01:56
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/red" android:orientation="vertical" > <EditText android:id="@+id/yaoqingcontent" android:layout_width="300dp" android:layout_height="150dp" android:background="@color/un_see" android:gravity="left" android:hint="请输入邀请内容" android:lines="5" android:padding="10dp" /></LinearLayout>
注意.里面的子控件一定要设置高度宽度..不然会根据位置跟着输入的文字大小
<style name="Theme_Transparent" parent="@android:Theme.DeviceDefault.Light.Dialog">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
</style>
样式
public void search() {// 邀请对方竞价Builderdialog = new AlertDialog.Builder(this,R.style.Theme_Transparent);LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.dailinput, null);dialog.setView(layout);yaoqingcontent = (EditText) layout.findViewById(R.id.yaoqingcontent);dialog.setPositiveButton("确认邀请", new DialogInterface.OnClickListener() {public void onClick(final DialogInterface dialog, int which) {//--------邀请对方的输入内容String key1 = "FromUID";String key2 = "ToUID";String key3 = "Content";String value1 = AESUtils.Encrypt(MyApp.getSP(context).getString("UUID", "0"), Web.TOKEN);// 当前用户idString vlaue2 = AESUtils.Encrypt(uID, Web.TOKEN);// 邀请对方的idString value3 = yaoqingcontent.getText().toString().trim();if (yaoqingcontent.getText().toString().trim().equals("")) {Toast.makeText(context, "请输入邀请内容", 0).show();} else {MyApp.getXHttpUtils(Web.KsbInvite, key1, value1, key2, vlaue2, key3, value3,new RequestCallBack<String>() {@Overridepublic void onFailure(HttpException arg0, String string) {Toast.makeText(context, "邀请失败!", 0).show();}@Overridepublic void onSuccess(ResponseInfo<String> info) {Toast.makeText(context, "邀请成功", 0).show();}});}}});dialog.setNegativeButton("取消邀请", new DialogInterface.OnClickListener() {public void onClick(DialogInterface dialog, int which) {dialog.dismiss();}});dialog.show();}
0 0
- 常用对话框、自定义对话框
- 对话框之自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- 自定义对话框
- linux下使用eclipse编译、链接、动态库的学习笔记
- 网站入侵检测之全方位突破安全狗
- AngularJs轻松入门(六)表单校验
- 「HD_ACM」Climbing Worm
- SQL中约束和触发器的停用与启用
- 自定义对话框
- 突破安全狗
- IETester在win7下支持IE7
- 临界区的使用
- 中文英语词典太烂,推荐两个在线的纯英文字典
- GitHub使用
- srm 181 div1 1000(状压dp)
- hash 建表 query 统计重复个数
- 突破安全狗上传文件