在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>
View Code

类库:

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);        }    }
View Code

引用:

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

更多相关文章

  1. android各种提示Dialog 弹出框
  2. 设置提示信息,输入值类型,输入框引入图片,设置输入框的形状
  3. Android消息提示框Toast
  4. Android仿百度谷歌自动提示——AutoCompleteTextView
  5. 《Android面试宝典》学习笔记(第四章:对话框、信息提示和菜单)
  6. Android提示版本更新的实现
  7. eclipse的android智能提示设置

随机推荐

  1. 在Android(安卓)Studio配置中遇到问题的
  2. 关于Android usb host 总结
  3. android 进程
  4. This Android SDK requires Andriod Deve
  5. Android Apps开发环境搭建
  6. Android 完全退出 App,Activity管理者 (Exi
  7. Android-gradle配置详解
  8. Android 资源文件夹下的文件不能有大写字
  9. Android的启动模式
  10. 如何解决Android运行时异常“Binary XML