在Fragnment弹窗提示

XML

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@drawable/bg_common_toast">
<ImageView
android:id="@+id/loadingdialog_fiv_icon"
android:layout_width="30dip"
android:layout_height="30dip"
android:src="@drawable/logo2" />
<TextView
android:id="@+id/loadingdialog_htv_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="left|center"
android:textColor="#004B7C"
android:textSize="14sp" />
</LinearLayout>

类库:

public class FlippingLoadingDialogF:DialogFragment
{
TextView textView1;
private string textViewText = "";
private Android.Views.Animations.Animation mAnimation;
public override Android.Views.View OnCreateView(Android.Views.LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Android 3.x+ still wants to show title: disable
Dialog.Window.RequestFeature(WindowFeatures.NoTitle);
// Create our view
var view = inflater.Inflate(Resource.Layout.common_flipping_loading_diloag, container, true);
// Handle dismiss button click
textView1 = view.FindViewById<TextView>(Resource.Id.loadingdialog_htv_text);
textView1.Text = textViewText;
ImageView mFivIcon=view.FindViewById<ImageView>(Resource.Id.loadingdialog_fiv_icon); return view;
}
public void SetText(string str)
{
textViewText = str;
} public override void OnResume()
{
// Auto size the dialog based on it's contents
Dialog.Window.SetLayout(LinearLayout.LayoutParams.WrapContent, LinearLayout.LayoutParams.WrapContent); // Make sure there is no background behind our view
Dialog.Window.SetBackgroundDrawable(new ColorDrawable(Color.Transparent)); // Disable standard dialog styling/frame/theme: our custom view should create full UI
SetStyle(DialogFragmentStyle.NoFrame, Android.Resource.Style.Theme); base.OnResume();
} protected override void Dispose(bool disposing)
{
base.Dispose(disposing); }
}

引用:

FlippingLoadingDialogF dialog = new FlippingLoadingDialogF ();
dialog.SetText ("数据加载中,请稍后...");
dialog.Show (this.Activity.FragmentManager, "dialog");

Momo自定义DialogFragment的更多相关文章

  1. Android 自定义dialogfragment

    在用dialogfragment的时候我们可能会不喜欢系统自带的黑色边框,那怎么办呢? dialofragment提供可供修改样式的方法setStyle(style,R.style.MyTryUseD ...

  2. PhotoPickerNewDemo【PhotoPicker0.9.12的个性化修改以及使用(内部glide版本号是4.1.1)】

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 本Demo使用的是PhotoPicker 0.9.12版本,里面集成的glide版本号是4.1.1.这里就不进行特殊的个性化处理了( ...

  3. 高仿Android网易云音乐OkHttp+Retrofit+RxJava+Glide+MVC+MVVM

    简介 这是一个使用Java(以后还会推出Kotlin版本)语言,从0开发一个Android平台,接近企业级的项目(我的云音乐),包含了基础内容,高级内容,项目封装,项目重构等知识:主要是使用系统功能, ...

  4. 自定义通用dialogFragment

    代码地址如下:http://www.demodashi.com/demo/12844.html 前言 之前写过一篇dialogFragmnet封装默认dialog的文章 DialogFragment创 ...

  5. Android开发:使用DialogFragment实现dialog自定义布局

    使用DialogFragment实现dialog的自定义布局最大的好处是可以更好控制dialog的生命周期. TestFragment的代码: public class TestFragment ex ...

  6. DialogFragment 自定义弹窗

    layout文件 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:a ...

  7. 详细解读DialogFragment

    原博客地址:http://www.cnblogs.com/tianzhijiexian/p/4161811.html 相信看这篇文章的人都应该知道android中的Dialog了吧,如果对于Dialo ...

  8. Android 官方推荐 : DialogFragment 创建对话框

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37815413 1. 概述 DialogFragment在android 3.0时 ...

  9. [Android Pro] Android 官方推荐 : DialogFragment 创建对话框

    转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/37815413 1. 概述 DialogFragment在android 3.0时 ...

随机推荐

  1. js中排序问题总结

    js的排序中通常使用到sort函数,可以用冒泡排序,插入排序,快速排序,希尔排序,系统方法等方法,本文结束后分享一个用着排序算法的链接,感兴趣可以了解了解. 1.常见的对一般数组进行排序,代码如下: ...

  2. ODBC与ADO 连SQL Server 2005

    ADO是microsoft数据库应用程序开发的连连接口,是建立在OLE DB之上的高层 ADO使用方法步骤: 1.初始化COM库,引入ADO库定义 2.用connection对象连接数据库 3.利用连 ...

  3. code complete part2

    基本数据类型: 1. 程序主体中仅能出现的数字就是0和1,除此之外,所有的数字都要用宏定义或者const类型,用清晰的变量名描述用途 2. 预防除零错误, assert(denominator!=0) ...

  4. MySQL判断字段值来确定是否插入新记录

    今天正好有个新需求,要求在一张表中,保证不插入重复的记录. 即,保证每条记录中的某个字段的值不重复. 下面是我给出的SQL语句: //存在-->更新 //不存在-->插入 UPDATE 表 ...

  5. Python3 之 import 和 当前目录

    环境: Python-3.4.3 Web.py-0.37 安装 web.py 的时候,提示 ImportError: No module named 'utils' 看看源码,setup.py,有这么 ...

  6. Linux中MySQL的基本操作

    1. 用root用户登录mysql mysql -u root -p 2. 查看database show databases; 3. 查看table use database名 show table ...

  7. (转) Awesome Deep Learning

    Awesome Deep Learning  Table of Contents Free Online Books Courses Videos and Lectures Papers Tutori ...

  8. 040. asp.netWeb中TreeView控件绑定XML文件

    xml文件格式: <?xml version="1.0" encoding="utf-8" ?> <sitemap title="进 ...

  9. 利用SPM工具运行自己创建的小组件(使用common-model向后台接口请求数据)

    步骤如下: 1.安装依赖:spm install -e 2.编译:spm build (编译好的东西会放在trunk-dist里面) 3.发布:spm app -d (会出来一个export端口,一般 ...

  10. ASP.NET MVC获取微信返回的json数据分页

    View @model JiaYe.WeiXin.Models.ViewModels.UserViewModel <div class="pull-left pagination&qu ...