在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 基础面试题

    function printArray(arr){ for(var i in arr){ if(arr[i] instance of Array){ printArray(arr[i]); }else ...

  2. Web集群缓存一致性的思考

    共享cache+数据库实现缓存一致性: 1.1 memcache + mongo+定时器 1.1.1 memcache 优点:web集群共享数据 缺点:数据生命周期的不可预估性 1.1.2 mongo ...

  3. Linux达人养成第一季

    Linux简介 一.Linux发展史 二.开源软件简介 三.Linux应用领域 四.Linux学习方法 五.Linux与Windows的不同 六.字符界面的优势 Linux系统安装 一.虚拟机安装 二 ...

  4. Validform使用ajax详解

    demo.config({    showAllError:true,    url:"这里指定提交地址",    ajaxpost:{        //可以传入$.ajax() ...

  5. Psam_ISO7816

    ISO7816协议1-4部分下载

  6. 关于 一开始不懂得 hosts配置。

    是转载别人的. 原文: http://my.oschina.net/cxz001/blog/298228   感谢分享: 一开始抄着陪着win下的hosts文件.然后配置  apache中的hosts ...

  7. ZipArchive之C++编译和调用

    由于要用到zip的解压,就上网下载了CZipArchive类的源码(还是2000年的),里面有个示例,稍微修改下,就能正常运行. 就高兴地把lib拿出来,放到项目中了.捣鼓了快一个下午了,死活编译不通 ...

  8. LeetCode-Remove Duplicates from Sorted Array II

    Follow up for "Remove Duplicates": What if duplicates are allowed at most twice? For examp ...

  9. Quartz2D之绘制一个简单的机器猫

    学习iOS有一段时间了,在博客园也默默的潜水了两个月,见识了很多大神,收获不少. 今天整理笔记,发现忘记的不少,我感觉需要及时的整理一下了,同时也把做的小东西贴上来和大家分享一下. 最近学习了Quar ...

  10. 好的bootstrap文章

    http://www.cnblogs.com/gamehiboy/p/5176618.html http://www.cnblogs.com/landeanfen/p/5821192.html htt ...