首页 > 移动平台 > 详细

Android Dialog

时间:2014-09-12 22:05:34      阅读:351      评论:0      收藏:0      [点我收藏+]
  1. Android提供了对话框支持,包括如下类别:
    • AlertDialog:功能最丰富,应用最广泛的对话框
    • ProgressDialog:进度条对话框
    • DataPickerDialog:日期选择对话框
    • TimePickerDialog:事件选择对话框

  2. 自定义Dialog
    //Style.xml代码 
    <style name="FullScreenDialog" parent="android:style/Theme.Dialog"> 
        <item name="android:windowNoTitle">true</item> 
        <item name="android:windowFrame">@null</item> 
        <item name="android:windowIsFloating">true</item> 
        <item name="android:windowIsTranslucent">false</item> 
        <item name="android:background">@android:color/black</item> 
        <item name="android:windowBackground">@null</item> 
        <item name="android:backgroundDimEnabled">false</item> 
    </style>
    使用AlertDialog的上层接口类:
     
    Dialog reNameDialog = new Dialog(getContext(), R.style.FullScreenDialog); 
    LayoutInflater mLayoutInflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); 
    View reNameView = mLayoutInflater.inflate(R.layout.audiorecord_rename, null); 
    LayoutParams params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); 
    reNameDialog.addContentView(reNameView, params); 
    reNameDialog.show();

Android Dialog

原文:http://www.cnblogs.com/phenixyu/p/3969100.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!