uilabel

Can i use a Tally marks fonts in UILabel?

泪湿孤枕 提交于 2019-12-25 02:22:26
问题 does Apple support usage of tally fonts ? i'm using this tally from here :http://www.subtangent.com/maths/resources.php with this coding: UILabel *subtitle = [[UILabel alloc]initWithFrame:CGRectMake(125, 2, 185, 30)]; [subtitle setBackgroundColor:[UIColor clearColor]]; [subtitle setFont:[UIFont fontWithName:@"Tally_Regular.ttf" size:19.0]]; [subtitle setText:@"5"]; [subtitle setTextColor:[UIColor blackColor]]; [fLikeThis addSubview:subtitle]; However it does't work as expected, not sure why

xcode UILabel text add outer glow effect

寵の児 提交于 2019-12-25 01:48:21
问题 How would I add an outer glow effect to a text of a UILabel. I tried to use the layer.shadow... properties but they are really just for a drop shadow. _count.backgroundColor = [UIColor clearColor]; _count.layer.masksToBounds = NO; _count.layer.shadowOpacity = .8; _count.layer.shadowRadius = 5.0; _count.layer.shadowColor = [UIColor whiteColor].CGColor; _count.layer.shadowOffset = CGSizeMake(0.0, 0.0); Thanks 回答1: So I determined there was no way to put this kind effect on text there are ways

Multi-line editable piece of text: editable UILabel?

房东的猫 提交于 2019-12-25 01:39:36
问题 I am trying to create a large plot of editable text but there seems to be 1 option: using a small UITextField. I know UILabels can be big and wide but I do not know how to make an editable UILabel. I experimented with UILabel properties and the .layer method but nothing seems to be really working. Anybody have a recommendation as to what I should do? To summarize, I am looking for a multi-line editable piece of text. 回答1: UITextView for the win!! UITextViews allow for multiple line

UILabel with Gesture Recognizer inside UITableViewCell blocks didSelectRowAtIndexPath

冷暖自知 提交于 2019-12-25 01:13:26
问题 I use some UILabels with a UITapGestureRecognizer inside a UITableViewCell . The GestureRecognizer works well. But when I tap on the label, I want that the didSelectRowAtIndexPath: should execute too. Or even just the indexPathForSelectedRow() method should give me the selected row. Setting cancelsTouchesInView = false did not work! Is this possible? Right now the indexPathForSelectedRow() method returns nil. Thanks 回答1: Why are you using UITapGestureRecognizer ? If you want to use that, try

Send TitleLabel from UIButton to a UILabel in a different UIView Controller, But it's not being sent

Deadly 提交于 2019-12-25 01:12:07
问题 I have one UIViewController that I am trying to send the titleLabel of a UIButton to a UILabel held within a different UIView Controller. I have followed the same steps and pattern as within a previous method that worked fine, but the Title Text is just not getting passed onto the next VC. I have a Button class called MtsCardsButton, but this just sets the animation and appearance of the button. Thank you for reviewing. Here is my code for the Button in the first VC: import UIKit class

How to Render a rotated UIlabel

旧时模样 提交于 2019-12-25 00:57:21
问题 I'm currently developing an app like photoshop for iPad and when i want flatten my array of layers, DrawTextInRect doesn't preserve the Transform ( CAAffineTransformMakeRotation ) of my UILabel . Anybody have any idea? 回答1: Draw your text into another context and get a CGImage of it, then see if drawing the image in your rotated context will work (it should). EDIT: I have not done this myself, I believe it will work. The label probably should not be inserted into a view when you do this, but

How to prevent UILabel.textColor to change in a dequeueReusableCell when scrolling?

非 Y 不嫁゛ 提交于 2019-12-24 19:31:07
问题 I have this code in my ViewController named PlayViewController : var words = [String]() var numberOfRevealedLabels = 1 var indexGA = 0 var indexWA = 0 override func viewDidLoad() { super.viewDidLoad() playTableView.delegate = self playTableView.dataSource = self view.isUserInteractionEnabled = true let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(self.respondToSwipeGesture)) swipeRight.direction = .right view.addGestureRecognizer(swipeRight) let swipeLeft =

How to make the 1st line in certain amount of text in a Label bold?

ε祈祈猫儿з 提交于 2019-12-24 19:07:47
问题 I have about 400 character length string with a heading called Details. In this 'Details' is to be bold and of fontsize 19. While all the remaining text starts in the next line and should be of fontSize 18 like the contents. How can I do all this by using a UILabel? Plz help me... 回答1: You can't do it with a stock UILabel as of SDK 3.2. You can create an NSAttributedString that specifies particular styles (like bold) for particular parts of the string, but there isn't a simple way to actually

viewDidLayoutSubviews is called when label changes (xcode) (swift)

六月ゝ 毕业季﹏ 提交于 2019-12-24 17:54:58
问题 I have a label, toggle button and an animation in my code. When I press the toggle button -> animation starts , label changes. Below is my code sample. override func viewDidLayoutSubviews() { println("viewDidLayoutSubviews is called") // Initial state of my animation. } @IBAction func Toggled(sender: AnyObject) { CallTextChange() // Two different Animations } func CallTextChange() { // Change text here} Every time I change the text in label viewDidLayoutSubviews is called. Is there a way to

iOS Swift Wrapping Text Around Image

孤者浪人 提交于 2019-12-24 17:23:14
问题 I have a UILabel that will contain various lengths of text. I need to place an image in the upper left corner of the text and have the text wrap around it. How can I do this? All I could find was using a UITextView which I don't want to use since it's static text. 回答1: This is a perfectly reasonable use of a UITextView. Your reasons for hesitation to use it are unclear. You can make the UITextView non-editable and non-selectable; the user will not know that it is a UITextView as opposed to to