uilabel

where are the labels among the buttons

余生长醉 提交于 2019-12-11 23:45:51
问题 In the image below I am attempting to put a single-character label between each button, but as the second image shows, when I do insert the labels, the buttons disappear and (if you look closely) the last button's text moves to the right. Can you help me get the desired result, please? buttons without labels buttons with labels ViewController.h @property(nonatomic,assign) UILabel* theSuit; ViewController.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the

When two labels show side by side with using the Masonry, how to make the width of each label show depending on its content?

你。 提交于 2019-12-11 23:07:23
问题 I want to use the Masonry to show two labels (UILabel) in the a line (view). But the left label is much wider than the right one. They shows like that in this picture.(The green label and yellow label.) The content compression of them are UILayoutPriorityRequired, I want the left side of the left label is equal to its superview and the right side of the right label is equal to its superview. Then how to make the width of each label show depending on its content with even more labels in a view

Gesture recogniser on UILabel, not working

蓝咒 提交于 2019-12-11 22:01:37
问题 I am trying to apply UITapGestureRecognizer on a UILabel in order to check and open e-mail service. The current UIView is a part of a UIViewController and displayed once user tap on a button. #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> @class AddressBook; @interface ContactInfoUI : UIView <MFMailComposeViewControllerDelegate, UIGestureRecognizerDelegate>{ IBOutlet UIView *view; UIViewController *mContainerVc; AddressBook *mAddressBook; } @property (nonatomic, retain)UIView *view;

Creating a dynamically sizing UILabel in the Xcode interface builder

两盒软妹~` 提交于 2019-12-11 21:36:01
问题 I want to be able to create a UILabel that will adjust it's size in a more complex way than normal AutoLayout. I've looked over the internet for an answer to this, but to no avail. Here's what I want it to do. Say you're viewing it on an iPhone. I want it to be 16 points away from either edge centered in the middle. (Height does not matter in any of this) However, when the screen gets wider, I want the UILabel to stretch so that it's 16 points away form each edge UNTIL it reaches, say, 500

Swift Stepper Action that changes UITextField and UILabel within same cell

左心房为你撑大大i 提交于 2019-12-11 20:17:27
问题 I am using a function to build my custom cell. the function used to create the cell is "makeMyList". The stepper I have successfully increments and decrements the itemQuantity textField. The trouble I am having comes with updating the "itemPrice" label. I want itemPrice.text to be quantity * price and update dynamically as the quantity either goes up or down dynamically. Could someone possibly help me with how to get this to happen? Thank you in advance! class MyListTableViewCell:

Draw line in UILabel before and after text

人走茶凉 提交于 2019-12-11 20:01:46
问题 I want to draw a line before and after a string in UILabel exactly like the following image: PS: the text is not static, so i can't tell what is the exact text width, otherwise i would put two static lines before and after the text. PS: Also i can't put the label above a line and give the label background color same to the view background because i have gradient color in the lower view. 回答1: I Hope below is what you was looking for... #import "ViewController.h" @interface ViewController () {

Align two labels vertically with different font size

笑着哭i 提交于 2019-12-11 19:34:23
问题 I have a parent UIView where I place two labels on it. Each of these labels only has one line as can be seen here: The problem now is that the baseline is wrong. I'm using auto layout and the question is how should my constraints should look like in this case? Especially the verticaly positioning of the labels. These are the constraints I currently have: H:|-[title]-2-[description]-(>=5)-| //with NSLayoutFormatOptions.AlignAllFirstBaseline V:|[title]| V:|[description]| The above constraints

UITableCell with auto layout configured multiline UILabel being truncated

谁都会走 提交于 2019-12-11 18:46:46
问题 I'm wrestling trying to get some multiline labels behaving inside tableview cells. I've already moved away from stacks that didn't work reliably at all as described in this question UILabel inside nested UIStackViews inside UITableViewCell sometimes truncating I fixed one of my views with the help of the comments on that question but another view just wouldn't work for me, even after moving to an autolayout non-stackview setup. I then ended up moving the cell that i couldn't get to work into

Changing a UILabel after a specific time

爷,独闯天下 提交于 2019-12-11 18:12:54
问题 Im a bit stuck and need some ideas. I want to make an app where it counts up from 0-12 then another UILabel changes to 1. The first label starts again from 0-12 then the label changes to 2. So on... I have tried a few ways adding in a NSTimer scheduledTimer and making a few selectors it worked to a certain extent but not to my liking. I don't need any code examples (although would be nice) but just some ideas would be nice thanks. :) 回答1: do you want to change label according to time or by

Custom UICollectionViewCell Subview Layout Issue

坚强是说给别人听的谎言 提交于 2019-12-11 18:03:57
问题 I have a custom UICollectionViewCell class that sets the background view of the cell to a downloaded image and also a UILabel added to it that sits neatly at the bottom of the cell and is slightly transparent (this label is the title of the image). It looks great in portrait but when I rotate my device to landscape the UILabel stays in its position while the custom cell resizes itself to better fit the screen. I have my UILabel fully constrained to the cell so I don't know why it isn't