【发布时间】:2021-08-17 10:56:15
【问题描述】:
我为 toast 创建了一个自定义渲染器。在那,我需要在左边提供填充。
UIViewController alert = new UIViewController();
UILabel view = new UILabel();
int DeviceWidth = (int)UIScreen.MainScreen.Bounds.Width;
float position = (DeviceWidth - DialogWidth) / 2;
view.Frame = new CoreGraphics.CGRect(position, 0, DialogWidth, 40);
view.Text = message;
view.Text.ToString().PadLeft(20, ' ');
alert.View.Add(view);
UIApplication.SharedApplication.KeyWindow.RootViewController.PresentViewController(alert, true, null);
【问题讨论】:
-
这能回答你的问题吗? UILabel with padding in Xamarin.iOS?
标签: xamarin.ios customization padding