当前位置: 首页>>代码示例>>C#>>正文


C# Card.SetImageLayout方法代码示例

本文整理汇总了C#中Card.SetImageLayout方法的典型用法代码示例。如果您正苦于以下问题:C# Card.SetImageLayout方法的具体用法?C# Card.SetImageLayout怎么用?C# Card.SetImageLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Card的用法示例。


在下文中一共展示了Card.SetImageLayout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var card = new Card(this);
            card.SetText("This is Bleu");
            card.SetFootnote("And I am relatively new");

            // this is purely for demo purposes
            var option = 3;
            switch (option)
            {
                case 0:
                {
                    card.SetImageLayout(Card.ImageLayout.Full);
                    card.AddImage(Resource.Drawable.bleu3);
                }
                break;
                
                case 1:
                {
                    card.SetImageLayout(Card.ImageLayout.Left);
                    card.AddImage(Resource.Drawable.bleu3);
                }
                break;
                
                case 2:
                {
                    card.SetImageLayout(Card.ImageLayout.Full);
                    card.AddImage(Resource.Drawable.bleu1);
                    card.AddImage(Resource.Drawable.bleu2);
                    card.AddImage(Resource.Drawable.bleu3);
                    card.AddImage(Resource.Drawable.bleu4);
                    card.AddImage(Resource.Drawable.bleu5);
                }
                break;
                
                case 3:
                {
                    card.SetImageLayout(Card.ImageLayout.Left);
                    card.AddImage(Resource.Drawable.bleu1);
                    card.AddImage(Resource.Drawable.bleu2);
                    card.AddImage(Resource.Drawable.bleu3);
                    card.AddImage(Resource.Drawable.bleu4);
                    card.AddImage(Resource.Drawable.bleu5);
                }
                break;
            }

            SetContentView(card.View);
        }
开发者ID:42Spikes,项目名称:F2S,代码行数:51,代码来源:MainActivity.cs

示例2: createCards

        private List<Card> createCards(Context context)
        {
            var cards = new List<Card>();

            foreach (var image in MainActivity.Bing.Images)
            {
                var bmp =
                    Bitmap.CreateScaledBitmap(
                        Bitmap.CreateBitmap(BitmapFactory.DecodeByteArray(image.Data, 0, image.Data.Length)), 640, 480,
                        false);
                var card = new Card(context);
                //card.SetText("HI!");
                card.AddImage(bmp);
                card.SetText(image.Description);
                card.SetImageLayout(Card.ImageLayout.Full);
                cards.Add(card);
            }

            return cards;
        }
开发者ID:42Spikes,项目名称:F2S,代码行数:20,代码来源:BingImagesActivity.cs

示例3: MvxCard

        public MvxCard(Context ctx, CardViewModelInfo vmi, MvxViewModel viewModel) 
        {
            Card = new Card(ctx);
            ViewModel = viewModel;
            CardInfo = vmi;

            var inpc = viewModel as INotifyPropertyChanged;
            if (inpc != null)
            {
                inpc.PropertyChanged += inpc_PropertyChanged;
            }
            Card.SetText(CardInfo.getText(viewModel));
            Card.SetFootnote(CardInfo.getFooter(viewModel));

            var bkg = CardInfo.getBackgroundBytes(viewModel);
            if (bkg != null)
            {
                var bmp = BitmapFactory.DecodeByteArray(bkg, 0, bkg.Length);
                Card.AddImage(bmp);
                Card.SetImageLayout(Card.ImageLayout.Full);
            }
        }
开发者ID:42Spikes,项目名称:F2S,代码行数:22,代码来源:MvxCard.cs


注:本文中的Card.SetImageLayout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。