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


C# ImageView.SetMinimumWidth方法代码示例

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


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

示例1: TabSetup

        void TabSetup(ActionBar.Tab tab, int resID)
        {
            var linLay = new LinearLayout(activity)
            {
                LayoutParameters = new LayoutParams(LayoutParams.WrapContent, 180),
                Orientation = Orientation.Vertical,
            };
            linLay.SetHorizontalGravity(Android.Views.GravityFlags.Center);
            var imageView = new ImageView(activity);
            imageView.SetImageResource(resID);
            imageView.SetPadding(-35, 4, -35, 0);
            imageView.SetMinimumWidth(60);

            var textView = new TextView(activity)
            {
                Text = tab.Text
            };
            linLay.AddView(imageView);
            linLay.AddView(textView);
            tab.SetCustomView(linLay);
        }
开发者ID:nodoid,项目名称:TabBarCustomViews,代码行数:21,代码来源:TabPage.cs

示例2: Initialize

		private void Initialize()
		{
			ImageView logo = new ImageView(Context) { Id = 0x0fffff2a };
			logo.SetImageResource(Resource.Drawable.logo);
			logo.SetAdjustViewBounds(true);
			logo.SetMinimumHeight(60);
			logo.SetMaxHeight(60);

			_imageCategoryView = new ImageView(Context);
			_imageCategoryView.SetAdjustViewBounds(true);
			_imageCategoryView.SetMinimumHeight(60);
			_imageCategoryView.SetMaxHeight(60);
			_imageCategoryView.Id = 0x0fffff2b;
			_imageCategoryView.SetMinimumWidth(60);
			_imageCategoryView.SetMaxWidth(60);
			_imageCategoryView.Measure(60, 60);

			_textCategoryView = new TextView(Context);
			_textCategoryView.SetMaxHeight(60);
			_textCategoryView.SetTextColor(Color.Black);
			_textCategoryView.Id = 0x0fffff2c;
			_textCategoryView.SetTextSize(ComplexUnitType.Sp, 15);
			_textCategoryView.Gravity = GravityFlags.CenterVertical;

			LayoutParams lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
			lp.AddRule(LayoutRules.AlignParentRight);
			lp.AddRule(LayoutRules.CenterVertical);
			AddView(logo, lp);

			lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
			lp.AddRule(LayoutRules.AlignParentLeft);
			lp.AddRule(LayoutRules.CenterVertical);
			AddView(_imageCategoryView, lp);

			lp = new LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
			lp.AddRule(LayoutRules.RightOf, _imageCategoryView.Id);
			lp.AddRule(LayoutRules.CenterVertical);
			lp.SetMargins(60, 0, 60, 0);
			AddView(_textCategoryView, lp);
		}
开发者ID:india-rose,项目名称:xamarin-indiarose,代码行数:40,代码来源:TitleBarView.cs

示例3: OnCreate

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

            /*SetContentView (new MapRenderer (this));*/
            alert = new AlertDialog.Builder(this).Create();

            codeDatabase = DataBase.Instance();

            DisplayMetrics metrics = Resources.DisplayMetrics;

            SetContentView(Resource.Layout.Game);
            this.Title = "Level: " + GlobalSupport.GameLevel.Remove(GlobalSupport.GameLevel.Length - 4, 4) + "; Lang: " + GlobalSupport.GameLanguage.ToString();

            SetGameSpeed();
            mapRenderer = new MapRenderer();
            robot = TiledParser.Parse(Assets.Open("Maps/" + GlobalSupport.GameDifficulty.ToString() + "/" + GlobalSupport.GameLevel),
                                      GlobalSupport.GameLevel);
            defRobotX = robot.xPosition;
            defRobotY = robot.yPosition;

            Robot.UpdateRobotEvent += new EventHandler(UpdateRobot);
            Robot.checkGoalsEvent += new EventHandler(CheckGoals);

            imgGameMap = FindViewById<ImageView>(Resource.Id.imgGameMap);

            imgGameMap.SetMinimumWidth(metrics.WidthPixels);
            imgGameMap.SetMinimumHeight(metrics.WidthPixels);

            imgGameMap.SetImageDrawable(new BitmapDrawable(Resources,
                                                              mapRenderer.Render(robot.level,
                                                                                   Resources,
                                                                                   robot.xPosition,
                                                                                   robot.yPosition)));

            txtCodeField = FindViewById<EditText>(Resource.Id.txtGameCodeInput);
            lblError = FindViewById<TextView>(Resource.Id.txtGameError);
            lblExecutedCode = FindViewById<TextView>(Resource.Id.btnGameCodeExecute);
            lblGoals = FindViewById<TextView>(Resource.Id.txtGoals);
            btnValidate = FindViewById<Button>(Resource.Id.btnGameCodeValidate);
            btnOptions = FindViewById<Button> (Resource.Id.btnGameOptions);

            _achievementManager = new AchievementManager();
            _achievementManager.AchievementUnlocked += (sender, e) =>
            {
                if (e is AchievementEventArgs)
                {
                    var achievementString = (e as AchievementEventArgs).data.message;
                    ShowPopUpMessage(achievementString);
                }
            };
            if (GlobalSupport.GameLanguage == EGameLanguage.Pascal)
            {
                _achievementManager.RegisterEvent(EAchievementType.StartPascal, 0);
            }
            else if (GlobalSupport.GameLanguage == EGameLanguage.Python)
            {
                _achievementManager.RegisterEvent(EAchievementType.StartPython, 0);
            }

            btnValidate.Click += (object sender, EventArgs e) =>
            {
                ValidateCode();
            };

            btnOptions.Click += (object sender, EventArgs e) =>
            {
                var optionsMenu = new Intent(this, typeof(ActivityOptions));
                StartActivity(optionsMenu);
            };

            btnReset = FindViewById<Button>(Resource.Id.btnGameCodeReset);

            btnReset.Click += (object sender, EventArgs e) =>
            {
                ResetCode(true);
            };

            btnSaveCode = FindViewById<Button>(Resource.Id.btnGameCodeSave);

            btnSaveCode.Click += (object sender, EventArgs e) =>
            {
                SaveCode();
            };

            btnOpenCode = FindViewById<Button>(Resource.Id.btnGameCodeOpen);

            btnOpenCode.Click += (object sender, EventArgs e) =>
            {
                OpenCode();
            };

            btnShareCode = FindViewById<Button>(Resource.Id.btnGameCodeShare);

            btnShareCode.Click += (object sender, EventArgs e) =>
            {
                ShareCode();
            };

            btnDeleteCode = FindViewById<Button>(Resource.Id.btnGameCodeDelete);
//.........这里部分代码省略.........
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:101,代码来源:ActivityGame.cs


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