Beispiel #1
0
        public void Create(SwipeMenu menu)
        {
            SwipeMenuItem callItem = new SwipeMenuItem(this)
            {
                Width      = 200,
                Background = new ColorDrawable(Color.Red),
                Title      = "hello",
                TitleColor = Color.Black,
                TitleSize  = 14

                             //IconRes = Resource.Mipmap.icon_like, // the word can be replaced by icon resource
            };

            menu.AddMenuItem(callItem);

            SwipeMenuItem copyItem = new SwipeMenuItem(this)
            {
                Background = new ColorDrawable(Color.Azure),
                Width      = 200,
                Title      = "hello",
                TitleColor = Color.Black,
                TitleSize  = 14

                             //IconRes = Resource.Mipmap.icon_delete,
            };

            menu.AddMenuItem(copyItem);
        }
Beispiel #2
0
        public void Create(SwipeMenu menu)
        {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                this);
            // set item background
            openItem.Background = new ColorDrawable(Android.Graphics.Color.Green);
            // set item width
            openItem.Width = dp2px(90);
            // set item title
            openItem.Title = "Open";
            // set item title fontsize
            openItem.TitleSize = 18;
            // set item title font color
            openItem.TitleColor = Color.White.ToArgb();
            // add to menu
            menu.AddMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                this);
            // set item background
            deleteItem.Background = new ColorDrawable();
            // set item width
            deleteItem.Width = dp2px(90);
            // set a icon
            deleteItem.Icon = new ColorDrawable(Android.Graphics.Color.Red);
            // add to menu
            menu.AddMenuItem(deleteItem);
        }
Beispiel #3
0
        public void Create(SwipeMenu menu)
        {
            // create "open" item
            SwipeMenuItem openItem = new SwipeMenuItem(
                this);

            // set item background
            openItem.Background = new ColorDrawable(Android.Graphics.Color.Green);
            // set item width
            openItem.Width = dp2px(90);
            // set item title
            openItem.Title = "Open";
            // set item title fontsize
            openItem.TitleSize = 18;
            // set item title font color
            openItem.TitleColor = Color.White.ToArgb();
            // add to menu
            menu.AddMenuItem(openItem);

            // create "delete" item
            SwipeMenuItem deleteItem = new SwipeMenuItem(
                this);

            // set item background
            deleteItem.Background = new ColorDrawable();
            // set item width
            deleteItem.Width = dp2px(90);
            // set a icon
            deleteItem.Icon = new ColorDrawable(Android.Graphics.Color.Red);
            // add to menu
            menu.AddMenuItem(deleteItem);
        }
        public void Create(SwipeMenu menu)
        {
            SwipeMenuItem item = new SwipeMenuItem(Activity.BaseContext);

            item.Title      = "Item 1";
            item.Background = new ColorDrawable(Color.Gray);
            item.Width      = Dp2Px(50);
            menu.AddMenuItem(item);

            item            = new SwipeMenuItem(Activity.BaseContext);
            item.Title      = "Item 2";
            item.Background = new ColorDrawable(Color.Red);
            item.Width      = Dp2Px(50);
            menu.AddMenuItem(item);
        }
        public void Create(SwipeMenu menu)
        {
            SwipeMenuItem openItem = new SwipeMenuItem(Context);

            openItem.Background = new ColorDrawable(Color.SkyBlue);
            openItem.Width      = Context.DpToPx(90);
            openItem.Title      = "打开";
            openItem.TitleSize  = 18;
            openItem.TitleColor = Color.White;
            menu.AddMenuItem(openItem);
            SwipeMenuItem deleteItem = new SwipeMenuItem(Context);

            deleteItem.Background = new ColorDrawable(Color.IndianRed);
            deleteItem.Width      = Context.DpToPx(90);
            deleteItem.Title      = "删除";
            openItem.TitleSize    = 18;
            openItem.TitleColor   = Color.White;
            menu.AddMenuItem(deleteItem);
        }
        public void Create(SwipeMenu menu)
        {
            SwipeMenuItem callItem = new SwipeMenuItem(this)
            {
                Width      = 200,
                Background = new ColorDrawable(Color.AliceBlue),
                IconRes    = Resource.Drawable.phone_co
            };

            menu.AddMenuItem(callItem);

            SwipeMenuItem copyItem = new SwipeMenuItem(this)
            {
                Background = new ColorDrawable(Color.Azure),
                Width      = (200),
                IconRes    = Resource.Drawable.copy
            };

            menu.AddMenuItem(copyItem);
        }
Beispiel #7
0
        public void Create(SwipeMenu menu)
        {
            SwipeMenuItem openItem = new SwipeMenuItem(MainActivity.mainActivity);

            openItem.Background = new ColorDrawable(Android.Graphics.Color.Green);
            openItem.Title      = "打开";
            openItem.TitleSize  = 20;
            openItem.Width      = 100;
            openItem.TitleColor = Android.Graphics.Color.White;

            SwipeMenuItem deleteItem = new SwipeMenuItem(MainActivity.mainActivity);

            deleteItem.Background = new ColorDrawable(Android.Graphics.Color.Gray);
            deleteItem.Title      = "删除";
            deleteItem.TitleSize  = 20;
            deleteItem.Width      = 100;
            deleteItem.TitleColor = Android.Graphics.Color.Black;

            menu.AddMenuItem(openItem);
            menu.AddMenuItem(deleteItem);
        }