How would you go about creating a rolling breaking news view, as you can see in apples notification center on the iphone (Where the stock is shown)?
Is there any open source examples of this?
Thanks in advance
`https://github.com/cbpowell/MarqueeLabel`
MarqueeLabel is a functional equivalent to UILabel that adds a scrolling marquee effect when the text of the label outgrows the available width (for the given font size). All standard UILabel properties are available in MarqueeLabel and it behaves just like a UILabel.
Related
I've been looking at answers and documentation but can't find anything on this topic. I'm fairly new to IOS development, so hopefully this question is relevant for here.
I have a TableView where user swipes right on a cell and font size of the label increases. However, in order to make it according to design specs I would also need to increase font weight. This is what I currently use:
self.infoLabel.font = [UIFont fontWithName:self.textLabel.font.familyName size:20 + 20*_intensityPercentage];
Other methods I've looked at seem to only switch bold on/off, however I'd need to adjust it continously.
Another problem with TableViewCell I'm facing is that UILabel would become blurier with left swipe. Is that even possible to do?
Any help is much appreciated. Thank you!
Per Is there a medium weight font between -systemFontOfSize: and -boldSystemFontOfSize:?, iOS doesn't support dynamic font weight. But since many fonts that ship with iOS ship with 3 or more "weights" within the font family you likely have more control available than normal / bold. For example, you might be able to dynamically rotate through HelveticaNeue-UltraLight to HelveticaNeue-Light to HelveticaNeue to HelveticaNeue-Medium to HelveticaNeue-Bold.
Check out http://www.iosfonts.com for a good dump of what fonts and weights are available to different versions of iOS.
I am looking for how to style a label in a UITableView cell, so that it shows how many children/messages are in the next view controller.
This is used in Apple's Mail app, to show how many messages are in the inbox or account.
I am sure that this is a UILabel, but what font, color and how to make the oval around it?
The font is surely bold Helvetica because that's what Apple uses everywhere in the iPhone UI. To get the exact color, you could take a screenshot and then sample the color with a color picker. For the rounded corners, experiment with a rather large label.layer.cornerRadius.
Instead of using UILabel.layer.cornerRadius, which results in terrible scrolling performance (as mentioned in my comment), subclass UILabel with a custom drawRect.
Here is the version that I use: http://gist.github.com/500793
Hello fellow developers, I am trying to include a UIPickerView that looks like the one shown within Oanda's Currency Coverter, because I think it's nice and neat. Please refer to image below.
I have read a few tutorials/samples including Apple's UICatalog but it doesn't seem to show us how to:
reduce the number of rows displayed (Oanda showing 3 rows only)
change the border colour (Oanda showing a black, and I have seen developers using an UIImage to cover up the edges of UIPickerView)
change the highlighted row overlay colour (Oanda has light green)
change the size of the picker
Would appreciate any help with sample code.
alt text http://topace.cc/img/photo.jpg
There is some discussion on the resizing of UIPickerView here, some approaches changed between iOS 3 and 4.
I am having a terrible time trying to get an input box like the one in the SMS app.
Can anyone offer some guidance on how to build one of these and make it look good? I need an input box that is shaped nicely like the UITextfield but will stretch vertically when typing.
I assume that I need to calculate width of the text and stretch the overlay image frame vertically when the text word wraps. The closest I have come does stretch but the cursor bounces all around when nearing the boundaries.
UPDATE:
I have worked on this everyday for a week and I have about given up on the UITextView. I can get it to stretch properly but when backspacing, the Textview height shrinks too much when going up a line. As I continue backspacing it corrects itself. For example, it displays this behavior when I am on line 4 and backspace up to line 3. Then as I continue backspacing, it corrects until I get to the end of line 2. Then it corrects itself,.... etc.
I decided to try to subclass UITextField but I can't even get it to display in the Frame size that I specify. 150,150,150,150.
Try Chat Input Sample. It has the similar look and functionality of SMS app.
Three20 project has a control that should do this for you.
From the Three20 README:
TTTextEditor is a UITextView which can
grow in height automatically as you
type. I use this for entering messages
in Facebook Chat, and it behaves
similarly to the editor in Apple's SMS
app.
You get to do this yourself. Luckily, the UITextField can notify you whenever its text changes using UITextFieldTextDidChangeNotification, and luckily NSString has methods (under the UIKit Additions) that let you get the height of the string given a certain width using boundingRectWithSize:options:attributes:context:, and luckily you can resize a UITextField yourself using frame.
I know this is old but for the people that still look at this answer there is now a nice control from Slack that does that called SlackTextViewController.
I need a textfield so an user could write several lines. Unfortunately a UITextField does not provide several lines, so I think I have to use an UITextView.
But the design of both are not the same.
Is it possible to design the UITextView like the UITextfield standard with white background and rounded corners?
Thanks a lot in advance & Best Regards.
In my self appointed role as interface-nazi, I feel compelled to point out that UITextField and UITextView have different appearances to communicate to users to expect a slightly different function.
In a textfield, a return ends editing. In a textview, it may only create a new line. In a textfield, links and phone numbers are not recognized. In a textview they are. Textviews can scroll. And so on...
You shouldn't create a non-standard interface element unless you have a strong compelling reason to do so. You should ask yourself how making a textview look like a textfield will help the user understand what actions they need to take to make the app work as they expect and wish it to.
Surprisingly small tweaks can create serious user confusion. A non-standard interface can introduce just slight pause, a half second, every time they use it. That minor confusion can degrade their perception of the utility of the app.
You can put a mask image with rounded borders over your textView. Background of UITextView can be changed by standard setBackgroundColor message.
Thanks to Timur here, you can use this chat input sample to implement a multiple line uitextview like what you see in the iPhone messaging app.
It helped me in my app :)
Here how it looks: