Is this a UITableView? How does this work? - iphone

Click the header section(or whatever it calls) will unfold the relative subcells,and the left triangle get rotated.
I have no idea how to code this.Is there anyone help me? Any code snippets would be great help.Thanks a lot.

That is a UITableView. You will need to add transparent buttons or a similar UIControl to the section headers to trap the tap events and then load the cells underneath

you can now see how to properly do it in an
example by apple.

Related

Button not clickable in Swift

I've got screen layout as shown in the screenshot below.
All looks good on screen but the button just won't react to any user input - i.e. connected #IBAction doesn't get triggered.
I believe that a specific constraint is causing the issue but I can't figure out why and they all look healthy to me.
Can anyone spot it or make out what the problem is?
Thanks for your help in advance!
As pointed out by #matt, I had a missing height constraint for the surrounding Container View. Once I added that the button did respond to user input again. Cheers #matt!!

Page Control Navigation Symbol?

Could someone point me in the right direction on how you get your Page Controller to show the navigation symbol like this?
I couldn't really describe it well, and couldn't find much relevant information on the internet. Anything would be great, thanks!
This is most likely a custom UIPageController.
Or you might be able to add a UIImageView to the left of the page control and when you try to swipe, set that image view to highlighted and you'll get the same effect.
Here's a custom page control, DDPageControl
https://github.com/ddeville/DDPageControl

Make UITextView scrollable

This seems so dumb, but I checked all the boxes that I have found as "solutions" to similar problems but nothing is quite working. I have a UITextView box that I want to be scrollable, and my settings are below. Anyone know why it isn't letting me scroll?
Please also make sure that User Interaction Enabled is checked in .xib file
I also had a problem with an unscrollable UITextView, but the other answers here didn't help (granted it was a special case: I only needed to scroll when the app was viewed horizontally).
Just in case anyone has a similar problem and lands here: what did help me was to activate vertical Autosizing (Size Inspector under View) for the textview.
Make sure you have text in your UITextView
Check to see if the UITextView is enabled (there's a property in settings) - it should be enabled.
Make sure you don't change these settings (or the "Scrolling Enabled" property) in your code.
Good luck !
you have to actually have texts inside the textview that overlap it original frame height to make it scrollable

Custom Cover Flow Implementation in iOS

Instead of Images in coverflow, I want to have a list buttons in a scrollView(For each of the image in the coverflow), clicking upon them should navigate to the other page, which again contains a list of buttons inside scrollview.
You can use iCarousel an open source library which accept UIViews as components :)
Hope this helps
Use - https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/AFOpenFlow/AFOpenFlowView.m
And override the touchesEnded event in AFOpenFlowView.m
This might help you.

Custom UITextField/UIButton

What I'm trying to do is replicate the NSTokenField like UITextField seen in the Mail app and Messages app (type a contact and it comes up with suggestions).
I've got the autocompleting working perfectly, when you type in a UITextField, a UITableView pops up showing any matches that it can find in an array, when you click one it adds it to the UITextField. I'm really happy with this so far.
The problem I've run into now is making the controls look like those in the native apps. Afterall, design is everything!
My first question is how can I add that shadow look to the UITableView? Looks like it's sunk down behind the UITextField.
Secondly, I know I'm going to have to subclass the UITextField to make it look the way I'd like it to, but I've got no idea where to start with that. Some pointers or a sample would be great!
Lastly, I think I need to create a custom UIButton with space for text and the blue gradient then add it to the UITextField. Same problem as with the UITextField, not really sure how to subclass the UIButton (what methods it needs to draw and stuff) or how to add it to the UITextField in such a way that when you click backspace on in the UITextField, the button will be highlighted, then deleted if backspace is clicked again (exactly how the NSTokenField works).
I've included an image just so you can see what I'm talking about:
http://www.thermoglobalnuclearwar.com/stuff/mail.jpg
I have taken a look at Joe Hewitts Three20 project but I couldn't make heads or tails of it.
I'd like to start very simply and understand everything that's going on rather than just dragging his code into mine and not having any idea what's going on!
Any help is greatly appreciated!
Thanks,
Tom.
Have you considered using the Three20 library? It contains a control which I think does what you want (TTPickerTextView).
As the website description states
TTPickerTextField is a type-ahead UITextField. As you type it searches a data source, and it
adds bubbles into the flow of text when you choose a type-ahead option. I use this in
TTMessageController for selecting the names of message recipients.
At a minimum the source code might give you some pointers on how to achieve the various visual effects.
Okay, I've got the shadow working underneath the UITextField, and I've added the "To:" label to it. It looks great!
So the final thing is the blue NSToken like control. I've started to think the easiest thing is just to subclass a UIView and draw the blue gradient and label inside it. Which brings me to some more questions:
I found this: http://github.com/leonho/iphone-libs/tree/master which draws a nice rounded view and I've adapted it to add some text to it rather than a number, what I don't know how to do is draw a gradient instead of a solid block of colour.
After that there's just the matter of adding the rounded views to the UITextField, moving the cursor and working out how to delete the views when the cursor reaches them, but I'll tackle that when I need to.