本文整理汇总了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);
}
示例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);
}
示例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);
//.........这里部分代码省略.........