我正在使用当前版本的Xamarin.iOS和C#开发一个iPad应用程序,试图创建一个UITableView
,其中只有两个角(右上角和右下角)是圆角的。 我知道如何通过设置myTable.Layer.CornerRadius = 6f;
来使所有角都变成圆角,但不知道如何仅使其中两个角变成圆角。我已经在SO上搜索过,但只看到了Objective-C的答案。这是我目前的代码:
private UIView GetModalRowHeaderView2(RectangleF bounds)
{
UIView view = new UIView(bounds);
view.BackgroundColor = UIColor.Gray;
string[] tableItems = new string[] {"Item One","Item Two","Item Three"};
UITableView myTable = new UITableView(new RectangleF(0, 20, bounds.Width, bounds.Height - 40), UITableViewStyle.Plain);
myTable.SeparatorInset = UIEdgeInsets.Zero;
myTable.ScrollEnabled = false;
myTable.Source = new TableSource(tableItems);
// Rounds all corners
myTable.Layer.CornerRadius = 6f;
view.Add(myTable);
return view;
}
有什么办法可以只将这个元素的两个角变为圆角呢?
谢谢。