使用Objective-C在iPhone应用程序中显示或隐藏UIButton [英] Show or Hide a UIButton in iPhone app with Objective-C
问题描述
我正在使用 UITextView
来编辑文字。我想使用两个 UIButtons
编辑和保存。最初我想显示编辑 UIButton
,当用户点击编辑时我想显示保存 UIButton
。当内容成功保存后,我不想再显示保存按钮了。
I am using UITextView
to edit text. I want to use two UIButtons
Edit and Save. Initially I want to show edit UIButton
, when the user click on edit I want to show save UIButton
. when the content successfully saved I dont want to show save button any more.
我是ac#coder,在c#中我曾经这样做过
I am a c# coder, in c# I used to do like this
C# code
btnedit.visible=true;
现在我想知道如何使按钮可见并且不能从目标c代码中看到。
Now I want to know how to make a button visible and not visible from objective c code.
谢谢,
推荐答案
由于 UIButton
继承自 UIView
,您只需在按钮上设置隐藏
属性(通过 UIButton doc )
Since UIButton
inherits from UIView
, you can just set the hidden
property on the button (via UIButton doc)
button.hidden = YES;
这篇关于使用Objective-C在iPhone应用程序中显示或隐藏UIButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!