linux read hat 5 语言环境切换
2010-06-28 11:16
253 查看
1、仅更改弹窗的显示内容
View view = View.inflate(this, R.layout.**, null);
new AlertDialog.Builder(this).setView(view);
2、更改弹窗的背景
如果使用AlertDialog的setView,弹窗的周边会有黑边出现,这时候则需要这么做
dialog_style:
dialog_bg:
dialog_bg 用于去掉黑色边,View中设置好需要的背景.
3、如果使用AlertDialog
AlertDialog dialog = AlertDialog.Builder(this).create();
dialog.show();
Window = dialog.getWindow();
view.setContentView(R.layout.**);
使用这种方法可以达到背景更换的效果,但是如果添加了EditText会出现,EditText不能弹出输入法的问题?
本文出自 “fly” 博客,请务必保留此出处http://fujian0910.blog.51cto.com/1706151/1159531
View view = View.inflate(this, R.layout.**, null);
new AlertDialog.Builder(this).setView(view);
2、更改弹窗的背景
如果使用AlertDialog的setView,弹窗的周边会有黑边出现,这时候则需要这么做
Dialog dialog = new Dialog(this, R.style.dialog_style); View view = View.inflate(this, R.layout.**, null); dialog.setContentView(view); dialog.show(); dialog.getWindow().setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); //自适应大小
dialog_style:
<style name = "dialog_style" parent="@android:style/Theme.Dialog"> <item name = "android:windowBackground">@drawable/dialog_bg</item> <item name = "android:windowNoTitle">true</item> </style>
dialog_bg:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" > <solid android:color="#00000000"/> </shape>
dialog_bg 用于去掉黑色边,View中设置好需要的背景.
3、如果使用AlertDialog
AlertDialog dialog = AlertDialog.Builder(this).create();
dialog.show();
Window = dialog.getWindow();
view.setContentView(R.layout.**);
使用这种方法可以达到背景更换的效果,但是如果添加了EditText会出现,EditText不能弹出输入法的问题?
本文出自 “fly” 博客,请务必保留此出处http://fujian0910.blog.51cto.com/1706151/1159531
相关文章推荐
- 如何在LINUX内核中添加模块--实验环境READ HAT LINUX 5.0
- 如何切换和更改Linux语言
- 我是这样学习Linux下C语言编程的-Linux下C语言编程环境的搭建
- Red Hat Linux 下命令行界面与图形界面的切换
- linux下改变语言环境变量为:UTF-8
- Red Hat Enterprise Linux 6 搭建 Lamp 环境 实践全程记录
- php版本切换的详细过程+线上Linux环境下常见php-fpm常见问题
- Red Hat Linux系统下SVN Server环境的构建
- linux(Red Hat Linux 9)中添加环境变量
- IOS多语言环境自由切换
- Red Hat Linux 下命令行界面与图形界面的切换
- Linux 安装go语言及配制环境变量
- linux下安装两个不同版本的交叉编译环境arm-linux-gcc4.4.3、arm-linux-gcc3.4.1,切换调用的解决
- 汇编语言:基于Linux环境
- Android app内语言环境切换
- 切换Win10系统语言环境的方法
- linux环境下设置joomla多语言多域名站点
- linux环境下编译链接汇编语言
- VMware安装linux(read hat)
- linux(readhat) yum源安装