Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当您在 iphone 上使用 safari 时,您可以在右下角看到页面控件。如果你按下这个按钮,所有的页面都会显示出来,它们也可以被编辑。
我尝试做类似的事情。我想按下工具栏上的编辑按钮,然后所有子视图都会在左上角出现一个删除控件(右上角都可以)。我尝试使用 tableviewcell(setEditing 方法),它显示删除控件,但没有出现在顶角。
你有什么想法?或者,我使用 tableviewcell 做错了吗?
表格视图单元格绝对不是这里的正确方法。该编辑控件是一个自定义控件,可能是带有红圈 X 图形的通用 UIButton。没有内置类可以为您提供您正在寻找的行为;您必须自己滚动,可能使用UIScrollView(pagingEnabled设置为YES),其中您的“页面”视图在其中排成一行。
UIScrollView
pagingEnabled
YES