我可以在视图中的某个位置而不是导航栏中使用UIBarButtonSystemItemCamera吗?

时间:2011-07-07 15:04:19

标签: iphone cocoa-touch camera uinavigationbar uibarbuttonitem

因此,我可以使用UINavigationBarUIBarButtonSystemItemCamera上添加一个“相机”按钮。

我想将相同的按钮添加到我视图中心的某个位置(120,160,10,10)。

我可以像UIButton一样使用它并使用相机按钮,或者我应该创建自定义按钮(看起来像UIBarButtonSystemItemCamera)并使用相同的方法吗?

1 个答案:

答案 0 :(得分:0)

我的建议是使用该相机图片创建UIButton(在谷歌图片中),然后根据需要设置尺寸,然后将其添加到您的视图

因为UIBarButtonItem不是从UIView继承的。它来自NSObject。

所以你无法将它们添加到你的View。