最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[无需解决]Swift中UITableView中让Cell的Accessory靠右对齐

Swift crifan 2739浏览 0评论

[已解决]Swift中的UITableView中自定义UITableViewCellAccessoryType

期间,需要cell的Accessory,靠右对齐:

当前的Accessory是离最右边还有是有点距离的。

 

accessory some distence to right

 

[折腾过程]

搜:

swift UITableView Cell Accessory alignment

swift TableView Cell Accessory alignment

参考:

uitableview – iOS UITableViewCell accessory on the left side? – Stack Overflow

iphone – Can a standard accessory view be in a different position within a uitableviewcell? – Stack Overflow

去试试:

        var moveAccessoryRightFrame = cell.accessoryView?.frame
        moveAccessoryRightFrame?.origin.x -= 30
        cell.accessoryView?.frame = moveAccessoryRightFrame!

根本没有效果。

 

[总结]

不过,后来发现:

即使是微信中的 消息 界面中的这个accessory,其实也是和屏幕最右边,之间是有点距离的

-》意味着:

本身UITableView的cell的accessory的水平位置,是没法简单的移动的

-》二是,保持和微信一致,此处也不需要去移动accessory的。

转载请注明:在路上 » [无需解决]Swift中UITableView中让Cell的Accessory靠右对齐

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.167 seconds, using 22.12MB memory