首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

语言转换的一些有关问题以及让dialog没有标题

2012-09-21 
语言转换的一些问题以及让dialog没有标题如果使用locale 可以进行语言转换,但是好像不能马上进行转换,要重

语言转换的一些问题以及让dialog没有标题

如果使用locale 可以进行语言转换,但是好像不能马上进行转换,要重新启动才开始

如果想马上实现效果 resource.updateConfiguration()更新一下

?

如果更新后还想做一写什么

android:configChanges="locale"?
@Override?
public void onConfigurationChanged(Configuration newConfig) {?
? //?更新一下吧
? super.onConfigurationChanged(newConfig);?
}?
2.

AlertDialog.Builder builder;?
AlertDialog alertDialog;?
?
Context mContext = getApplicationContext();?
LayoutInflater inflater = (LayoutInflater)?
? ? ? ? mContext.getSystemService(LAYOUT_INFLATER_SERVICE);?
View layout = inflater.inflate(R.layout.custom_dialog,?
? ? ? ? (ViewGroup) findViewById(R.id.layout_root));?
?
TextView text = (TextView) layout.findViewById(R.id.text);?
text.setText("Hello, this is a custom dialog!");?
ImageView image = (ImageView) layout.findViewById(R.id.image);?
image.setImageResource(R.drawable.android);?
?
builder = new AlertDialog.Builder(mContext);?
builder.setView(layout);?
alertDialog = builder.create();?

热点排行