タイトルの通りですが、
下記のコードはbutton1, view1, button2をAddArrangedSubviewしています。
が、view1だけ表示されないのです。なぜでしょうか?
public override void ViewDidLoad() { base.ViewDidLoad(); // ナビゲーション非表示 NavigationController.SetNavigationBarHidden(true, true); // メインビュー m_MainStackView = new UIStackView(View.Frame) { Axis = UILayoutConstraintAxis.Vertical, Alignment = UIStackViewAlignment.Center, Distribution = UIStackViewDistribution.EqualSpacing, Spacing = LoginConst.SPACING }; View.AddSubview(m_MainStackView); UIButton button1 = new UIButton(new CGRect(0, 0, 100, 100)); button1.BackgroundColor = UIColor.Brown; m_MainStackView.AddArrangedSubview(button1); UIView view1 = new UIView(new CGRect(0, 0, 100, 100)); view1.BackgroundColor = UIColor.Red; m_MainStackView.AddArrangedSubview(view1); UIButton button2 = new UIButton(new CGRect(0, 0, 100, 100)); button2.BackgroundColor = UIColor.Blue; m_MainStackView.AddArrangedSubview(button2); }
◆環境
Visual Studio 2017
Xamarin 4.12
Xamarin.iOS 12.2
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/05/31 02:27