展会信息港展会大全

android Dialog设置没有标题注意的地方
来源:互联网   发布日期:2015-10-03 11:31:12   浏览:1507次  

导读:android Dialog设置没有标题注意的地方[代码]看注解layoutInflater = LayoutInflater.from(mContext); final Dialog dialog = new Dialog(mContext); View popView = layoutInflater.inflate(R.lay......

android Dialog设置没有标题注意的地方

[代码]看注解

layoutInflater = LayoutInflater.from(mContext);

final Dialog dialog = new Dialog(mContext);

View popView = layoutInflater.inflate(R.layout.popupwindow, null);

//设置Dialog没有标题,这个一定要在设置内容之前定义

dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

dialog.setContentView(popView);

//设置Dialog没有标题,在之后定义就会报错

//dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

dialog.setCancelable(true);

viewFilpper = (ViewFlipper) popView.findViewById(R.id.viewFlipper);

viewFilpper.setInAnimation(AnimationUtils.loadAnimation(mContext, R.anim.menu_in));

viewFilpper.setOutAnimation(AnimationUtils.loadAnimation(mContext, R.anim.menu_out));

viewFilpper.setFlipInterval(60000);

ImageView imagView = (ImageView) popView.findViewById(R.id.caihead);

imagView.setImageBitmap(list.get(m-1));

Button button =(Button) popView.findViewById(R.id.speed);

Button detail =(Button) popView.findViewById(R.id.deleat);

dialog.show();

赞助本站

人工智能实验室

相关热词: Dialog

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港