Beispiel #1
0
        private void SetupListViews(ListView list)
        {
            RelativeLayout.LayoutParams listParam = (RelativeLayout.LayoutParams)list.LayoutParameters;

            int anchor = listParam.GetRule(LayoutRules.Below);

            RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
            param.AddRule(LayoutRules.Below, anchor);
            param.AddRule(LayoutRules.CenterHorizontal);

            ProgressBar progress = new ProgressBar(Activity)
            {
                LayoutParameters = param,
                Indeterminate    = true
            };

            list.EmptyView = progress;

            RelativeLayout parent = (RelativeLayout)list.Parent;

            parent.AddView(progress);
        }