简体   繁体   English

如何使按钮看起来像这样? (iPhone的计时器应用)

[英]How to make a button look like this? (the iPhone's Timer App)

alt text

To me, this looks like a UITableViewCell, but with rounded corners. 对我来说,这看起来像UITableViewCell,但带有圆角。 I also want the behavior of my "button" to do behave the same way as in the timer App. 我还希望我的“按钮”的行为与计时器App中的行为相同。 How do I do it? 我该怎么做?

EDIT: By "button" I mean the one that says "When Timer Ends". 编辑:“按钮”我的意思是说“当计时器结束”。 again, to me it looks like a TableViewCell. 再次,对我来说,它看起来像一个TableViewCell。 Thanks for the speedy responses guys. 感谢大家的迅速反应。

This question has already been asked: see here for the tutorial . 已经问过这个问题: 有关教程,请参见此处

EDIT: It looks like the "button" is actually a UITableViewCell (although it's hard to tell for sure). 编辑:看起来“按钮”实际上是一个UITableViewCell (尽管很难确定)。 For a tutorial on customizing table cells, see here . 有关自定义表格单元格的教程, 请参见此处

I think the way to achieve this is a combination of a UITableViewCell and a UIButton. 我认为实现此目的的方法是将UITableViewCell和UIButton组合在一起。

The UITableViewCell will give you the table-view-cell style, and the UIButton will allow you to select it as you would select a table view cell in a table view. UITableViewCell将为您提供table-view-cell样式,UIButton将允许您选择它,就像在表格视图中选择表格视图单元格一样。

In order to be able to select the UIButton, place it in front of the UITableViewCell and reduce it's alpha level to something around 0.2-0.3. 为了能够选择UIButton,请将其放在UITableViewCell的前面,并将其alpha级别降低到0.2-0.3左右。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM