你怎么能在Xamarin.iOS UITableView上只绕过2个角?

 手机用户2502875017 发布于 2023-01-31 16:26

我正在使用当前版本的Xamarin.iOS和C#开发一个iPad应用程序,我正在尝试创建一个UITableView只有两个角(右上角和右下角)四舍五入的角色.我知道如何通过设置myTable.Layer.CornerRadius = 6f;但不知道如何只围绕其中的两个来使所有角落四舍五入.我环顾四周,但只能看到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;
    }

任何想法我怎么能改变这只到圆角的两个角落?

谢谢,

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有