自定义对话框

  • r2_666266
    了解作者
  • 78.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-14 08:07
    上传日期
自定义对话框样式public class DialogDemoActivity extends Activity { /** Called when the activity is first created. */ private Button btn=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); btn= (Button)findViewById(R.id.button1); btn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //第一种方法 //第二个参数:这个对话框大体长什么样 // Dialog dialog1=new Dialog(DialogDemoActivity.this,R.style.MyDialog111); // //设置这个对话框的界面长什么样 // dialog1.setContentView(R.layout.dialog_new); // dialog1.show(); //第二种方法 //向上转型 Dialog dialog2=new MyDialog(DialogDemoActivity.this, R.style.MyDialog111); dialog2.show(); //只能调用父类和子类共有的成员,并且执行的是子类的成员(因为是子类生成的对象,父类没生成对象—) } }); } }
dialogDemo.zip
内容介绍
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package sn.demo; public final class R { public static final class attr { } public static final class drawable { public static final int chat=0x7f020000; public static final int icon=0x7f020001; public static final int line_up=0x7f020002; public static final int new_yixun_detail=0x7f020003; public static final int smile=0x7f020004; public static final int talk=0x7f020005; } public static final class id { public static final int button1=0x7f060007; public static final int dialog_button_cancel=0x7f060001; public static final int dialog_button_ok=0x7f060002; public static final int dialog_title_image=0x7f060000; public static final int top_title2=0x7f060003; public static final int yixun_detail=0x7f060006; public static final int yixun_image=0x7f060004; public static final int yixun_title=0x7f060005; } public static final class layout { public static final int dialog=0x7f030000; public static final int dialog_new=0x7f030001; public static final int main=0x7f030002; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } public static final class style { public static final int MyDialog111=0x7f050000; } }
评论
    相关推荐
    • FreeMaker IDE
      FreeMarker的Eclipse插件,可以高亮显示FTL标签,提示语法错误,以及智能提示!
    • selenium ide
      selenium ide下载,fire path
    • IDE设置
      IDE设置
    • FreeMaker IDE
      FreeMaker IDE FreeMaker IDE
    • silabs ide
      用于调试51F023的软件 可以与CE3配套使用
    • ide
      ide
    • ide
      ide
    • IDE Factory
      【名称】IDE Factory 【作用】Flex Builder的AS3开发插件,主要用于生成Geter and Setter 、Format code...etc 【版本】Beta2 1.05(2008.12.20 最新) 【官网】开代理访问 www.idefactory.com 【已知Bug】 根据...
    • SiLabs IDE
      新华龙公司特别为C8051系列开发的编译软件IDE,界面很直观,非常好用!
    • Perl IDE
      一个Perl的程序设计器。