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.
是否可以创建具有多个标签的按钮?例如imageView、textLabel 和detailTextLabel。
我不认为使用界面生成器是可能的,但也许我们可以通过将 UIImage 和 UILabels 添加到按钮的视图来以编程方式进行。如果我确实编写了一个自定义 UIButton 类,那么处理状态更改的最佳方法是什么?
另外,我只是好奇苹果是否会批准带有多个标签和图像的自定义按钮。
您可以使用所有这些子视图创建一个视图,并在其上放置一个自定义透明按钮以获取对该视图的点击。要处理状态,您可以用一些灰色调的背景绘制半透明的按钮,以产生禁用按钮的效果。高温高压