Android开发视频教程《游戏数独》

Android开发视频教程《游戏数独》

5 (10人评价)

千锋3G学院-Android游戏开发教程-数独-第6讲的笔记

相关课时: 笔记详情:

//可以分成2大块来看!!!
//1、第一块是 创建View,把自定义的布局文件转换成View对象;
LayoutInflater layout = LayoutInflater.from(this.getContext());
View layoutView = layout.inflate(R.layout.dialog, null);
TextView textView = (TextView) layoutView.findViewById(R.id.textID);
textView.setText(sb.toString());

//2、创建Dialog对象并把设置好的View填充进去;
AlertDialog.Builder builder = new AlertDialog.Builder(this.getContext());
builder.setView(layoutView);
AlertDialog dialog = builder.create();
dialog.show();

0 0

你感兴趣的课程

8万+浏览/ 916学员/ 4.5评分
免费
6万+浏览/ 177学员/ 5评分
免费
6万+浏览/ 971学员/ 4.8评分
免费