Good day..! I would like to ask some assistance no how to accomplish this task in xcode?
here's the scenario.. I have several buttons.. example below..
--> Sample
--> Sample
--> Sample
When you clicked on the first sample1, it will display a text containing information.. when you clicked again sample1, it will return to its original position..
Example when clicked
--> Sample1
--> Information here
--> Sample2
--> Sample3
when clicked again
--> Sample1
--> Sample2
--> Sample3
Hope to hear from you soon..
Thanks,
Link
You can set the hidden property as mayuur and iDhaval suggested
view.hidden = YES; // or
view.hidden = NO;
or by calling setHidden:
[view setHidden:YES]; // or
[view setHidden:NO];
You could also set the alpha property of the view to 0.0f, but know that it still receives touch events.
view.alpha = 0.0f; // or
[view setAlpha:0.0f];
See ColdLogic's answer to UIView hidden property...is there more to it? for code to animate the view "fading out," and Torsten Walter's answer to what's the difference between view's hidden = yes and alpha = 0.0f for more information on the difference between setting the alpha property of a view to 0.0f and setting its hidden property to YES, and how iOS handles it in different contexts. The relevant Apple documentation on UIView could prove helpful, too.
In case you want to animate the showing and hiding of those informational text views by moving them, it wouldn't be much of a stretch to modify the code at iDev Recipes for implementing side swiping on a table as in the Twitter app. The full source code is available on GitHub.
For more complex animation, reference Apple's Core Animation Programming Guide.
Since I'm new to the site and it's limiting the number of hyperlinks I can include, you'll have to copy and paste the URLs next to the bullets.
Please use the hidden
property with respective view on click event of button.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With