uilabel

iPhone's UILabel with URL detection

ぃ、小莉子 提交于 2019-12-21 02:52:04
问题 I'm looking for an iPhone control that can simply display some text and detect URL's (http, email, tel) inside that text. UILabel doesn't support URL detection. UITextView can do that, but it's too heavy for use in chat application that I'm developing. Any suggestions will be appreciated. 回答1: You can use the same tools that the facebook app uses: three20 Joe Hewitt, the developer behind the facebook app has open sourced much of his work. You can get it and many other goodies here. 回答2: Craig

Centering Label Vertically in UINavigationBar TitleView

拈花ヽ惹草 提交于 2019-12-20 15:25:08
问题 I'm not having much luck centering vertically the label I'm adding to the TitleView on the UINavigationBar . You can see what it looks like below. This is how I'm adding the label: UILabel *titleLabel = [[UILabel alloc] init]; titleLabel.text = NSLocalizedString(@"activeSessionsTitle",@""); titleLabel.font = [Util SETTING_NEO_HEADER_FONT]; titleLabel.textColor = [UIColor whiteColor]; titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.textAlignment = UITextAlignmentCenter;

Adding text over an image on Xcode

北城以北 提交于 2019-12-20 14:30:11
问题 I want to make an iphone application similar to some greeting cards application, where I could write text over some pre prepared background images(cards). How can I write this text? How to save the background image+the text on one image file ? Thanks. 回答1: Here is a method that burns a string into an image. You can tweak the font size and other parameters to configure it to your liking. /* Creates an image with a home-grown graphics context, burns the supplied string into it. */ - (UIImage *

UILabel font : bold and italic [duplicate]

谁说我不能喝 提交于 2019-12-20 13:37:47
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How do I set bold and italic on UILabel of iPhone/iPad? I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code, lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; or lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]]; I want my

UILabel font : bold and italic [duplicate]

本秂侑毒 提交于 2019-12-20 13:37:08
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How do I set bold and italic on UILabel of iPhone/iPad? I am trying to make UILabel font bold and italic both using system font, but I cant use these both style at a time. so is it possible to make font bold and italic using system font? here is my code, lblTitle.font = [UIFont italicSystemFontOfSize:[UIFont systemFontSize]]; or lblTitle.font = [UIFont boldSystemFontOfSize:[UIFont systemFontSize]]; I want my

UITapGestureRecognizer initWithTarget:action: method to take arguments?

↘锁芯ラ 提交于 2019-12-20 10:59:27
问题 I'm using UITapGestureRecognizer because I'm using a UIScrollView that acts as a container for my UILabel s. Basically I'm trying to use an action method with arguments so I can e.g. send myLabel.tag value to the action method to know what action to take depending on what UILabel has has been triggered by a tap. One way of doing it is having as many action methods as UILabel s but that isn't very "pretty" codewise. What I would like to achieve is just having one action method with switch

Add Custom Fonts In Xcode 4.1

十年热恋 提交于 2019-12-20 10:43:34
问题 i want to use custom fonts in y application. i have declared the "Fonts provided by the application" in the info.Plist file and set the label.font to the font with name with / without the .TTF extension draged the TTF file in to the project and copied the file to the project created an outlet to the label but still, nothing works. if someone knows what is going on over there i would like to get some help. recently i have noticed the this problem are known @ the 4.1 (xcode version). TNX :) 回答1

UILabel subclass initialize with custom color

耗尽温柔 提交于 2019-12-20 10:43:30
问题 My goal is to set the textColor of my custom UILabel subclass in my view controller. I have a UILabel subclass named CircleLabel . Here are the basics of it: class CircleLabel: UILabel { required init(coder aDecoder: NSCoder) { super.init(coder: aDecoder)! } override init(frame: CGRect) { super.init(frame: frame) } override func drawRect(rect: CGRect) { self.layer.cornerRadius = self.bounds.width/2 self.clipsToBounds = true super.drawRect(rect) } override func drawTextInRect(rect: CGRect) {

draw only top, right, and bottom border around a uilabel

拜拜、爱过 提交于 2019-12-20 10:28:10
问题 i try to add border for a uilabel, but i only want to have top, right, and bottom border. like this ---------------- | I am a label | | ---------------- I try to use these codes, but it adds all 4 sides by default myLabel.layer.borderWidth = 1; myLabel.layer.borderColor = [UIColor blackColor]; Is that anyway i can only add 3 sides, or even 1 or 2 sides? Thanks! 回答1: You can use a mask. This is the code I used to test the theory, and it works well: // Define the border width in a variable, we

Top-aligning text of different sizes within a UILabel

我怕爱的太早我们不能终老 提交于 2019-12-20 10:06:12
问题 How to top-align text of different sizes within a UILabel? An example is top-aligning smaller-sized cent amount with larger-sized dollar amount in price banners. UILabel in iOS6 supports NSAttributedString which allows me to have text of different sizes in the same UILabel. However it doesn't seem to have an attribute for top-aligning text. What are the options to implement this? It seems to me that providing a custom drawing logic to do top-alignment based on a custom attributed string key