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


C# ImageView.SetMinimumHeight方法代码示例

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


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

示例1: 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

示例2: Initialize

    private void Initialize()
    {
      mFlipAnimation = new RotateAnimation(0, -180,
                Android.Views.Animations.Dimension.RelativeToSelf, 0.5f,
                Android.Views.Animations.Dimension.RelativeToSelf, 0.5f);


      mFlipAnimation.Interpolator = new LinearInterpolator();

      mFlipAnimation.Duration = 250;
      mFlipAnimation.FillAfter = true;

      mReverseFlipAnimation = new RotateAnimation(-180, 0,
              Android.Views.Animations.Dimension.RelativeToSelf, 0.5f,
              Android.Views.Animations.Dimension.RelativeToSelf, 0.5f);

      mReverseFlipAnimation.Interpolator = new LinearInterpolator();
      mReverseFlipAnimation.Duration = 250;
      mReverseFlipAnimation.FillAfter = true;


      mInflater = Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;

      mRefreshView = (RelativeLayout)mInflater.Inflate(Resource.Layout.pull_to_refresh_header, this, false);

      mRefreshViewText =
          (TextView)mRefreshView.FindViewById(Resource.Id.pull_to_refresh_text);
      mRefreshViewImage =
          (ImageView)mRefreshView.FindViewById(Resource.Id.pull_to_refresh_image);
      mRefreshViewProgress =
          (ProgressBar)mRefreshView.FindViewById(Resource.Id.pull_to_refresh_progress);
      mRefreshViewLastUpdated =
          (TextView)mRefreshView.FindViewById(Resource.Id.pull_to_refresh_updated_at);

      mRefreshViewImage.SetMinimumHeight(50);
      
      mRefreshView.SetOnClickListener(new OnClickRefreshListener(this));

      mRefreshOriginalTopPadding = mRefreshView.PaddingTop;

      mRefreshState = TAP_TO_REFRESH;

      AddHeaderView(mRefreshView);

      base.SetOnScrollListener(this);


      MeasureView(mRefreshView);
      mRefreshViewHeight = mRefreshView.MeasuredHeight;
    }
开发者ID:Toshik,项目名称:MonoDroid.PullToRefreshListView,代码行数:50,代码来源:PullToRefreshListView.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.SetMinimumHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。