uibutton

Breakline in UIButton title

谁说胖子不能爱 提交于 2020-01-04 06:30:17
问题 in the following button is an address showed. My problem is the addresses are very long and how can i get between the two variables in the title of the button an breakline?? NSString *sitz = map.kordinate.herkunft; NSString *strasse = map.kordinate.strasse; NSString *strasseMitKomma = [strasse stringByAppendingString:@","]; NSString *fertigesSitzFeld = [strasseMitKomma stringByAppendingString:sitz]; UIButton *firmensitz = [UIButton buttonWithType:UIButtonTypeRoundedRect]; the breakline must

iphone - how to scroll uiscrollview from event touched by uibutton in scrollview

人走茶凉 提交于 2020-01-04 05:35:23
问题 structure UIViewController - UIScrollview - UIButton I'm going to make scrollview can receive button event. So whenever user do scrolling(dragging) on the button, the scrollview react as scrolling itself. I made button down and moved handler with event forwarding like below - (IBAction)buttonTouchedMove:(id)sender withEvent:(UIEvent *)event { [[sender nextResponder] touchesMoved:[event allTouches] withEvent:event]; } - (IBAction)buttonTouchedDown:(id)sender withEvent:(UIEvent *)event { [

iOS Masonry 等间隔或等宽高排列多个控件

元气小坏坏 提交于 2020-01-03 23:06:42
masonry 目前提供了相应的接口,直接使用即可 1、固定宽高不固定间隔 /* MASAxisType :横排还是坚排 withFixedItemLength : 控件的宽或高 leadSpacing: 第一个控件与边缘的间隔 tailSpacing : 最后一个控件与边缘的间隔 */ mas_distributeViewsAlongAxis:(MASAxisType) withFixedItemLength:(CGFloat) leadSpacing:(CGFloat) tailSpacing:(CGFloat) 2、固定间隔不固定宽高 /* MASAxisType :横排还是竖排 withFixedSpacing: 两个控件间隔 leadSpacing:第一个控件与边缘的间隔 tailSpacing: 最后一个控件与边缘的间隔 */ mas_distributeViewsAlongAxis:(MASAxisType) withFixedSpacing:(CGFloat) leadSpacing:(CGFloat) tailSpacing:(CGFloat) 两个API,分为固定间隔不固定宽高,固定宽高不固定间隔,根据具体需求使用相应的即可。 需要注意的是 : 横排的时候要相应设置控件数组的垂直约束,竖排的时候要相应设置控件数字的水平约束。 例1:水平方向排列、固定控件间隔

IOS 7.1: UIButton's selected title not working [duplicate]

倾然丶 夕夏残阳落幕 提交于 2020-01-03 15:26:25
问题 This question already has answers here : UIButton's Selected State not working in iOS7 (3 answers) Closed 5 years ago . Today I upgraded my iPhone OS to iOS 7.1 . Everything looks good in the new iOS, but I have a critical issue regarding UIButtons in the app I'm working on. The selected state was gone in every button. For instance, Like button has title of "Liked" when selected but it's not shown at all when selected right now. Buttons have only text without background/image in every state.

IOS 7.1: UIButton's selected title not working [duplicate]

拥有回忆 提交于 2020-01-03 15:25:22
问题 This question already has answers here : UIButton's Selected State not working in iOS7 (3 answers) Closed 5 years ago . Today I upgraded my iPhone OS to iOS 7.1 . Everything looks good in the new iOS, but I have a critical issue regarding UIButtons in the app I'm working on. The selected state was gone in every button. For instance, Like button has title of "Liked" when selected but it's not shown at all when selected right now. Buttons have only text without background/image in every state.

Using PDFs for icon images in Xcode 7.2

情到浓时终转凉″ 提交于 2020-01-03 14:16:09
问题 I'm attempting to use PDF files as icons in an app I'm working on. The issue I'm encountering is I'm getting inconsistent tint colors. If I set a button image from interface builder, the icon image shows up black at runtime. Every time. Regardless of what I attempt to set from interface builder. I tried setting my button icon image via code and instead of showing up black , it's white : let myGraphicFile = UIImage(named: "myPDFImage") let myButtonImage = myGraphicFile?.imageWithRenderingMode

UIButton action is not triggered after constraint layouts changed

南楼画角 提交于 2020-01-03 08:42:13
问题 I have got an UIButton on a storyboard ViewController. When I load data into the form and the layout is significantly changing the button does not recognise the touch action. I have figured out that when button is visible on the scrollview right after it if filled with data, the touch action works. If the data too long and the button is not visible at first, just when it is scrolled into the display, the touch action does not work. I was checking if something is above the button, but nothing.

UIButton action is not triggered after constraint layouts changed

给你一囗甜甜゛ 提交于 2020-01-03 08:41:27
问题 I have got an UIButton on a storyboard ViewController. When I load data into the form and the layout is significantly changing the button does not recognise the touch action. I have figured out that when button is visible on the scrollview right after it if filled with data, the touch action works. If the data too long and the button is not visible at first, just when it is scrolled into the display, the touch action does not work. I was checking if something is above the button, but nothing.

Increase and Decrease values on Button click

可紊 提交于 2020-01-03 06:25:23
问题 I want to show value on UIlabel. when I press UIbutton to increase or decrease values on label. This is my code and when I am running my project but I didn't get any value on my uilabel. @IBAction func btnIncreaseAction(_ sender: Any) { var count = 0 count = (count + 1) if let cell = (sender as? UIButton)?.superview?.superview?.superview as? ShoppingCell { //cell.lblForOnty.text = "\(cell.lblForOnty.text ?? 0 + 1)" cell.lblForOnty.text = String(count) } } func tableView(_ tableView:

Cancel touch on UIButton on touch move (iOS)

拥有回忆 提交于 2020-01-03 05:37:08
问题 I have a view with button and touch-move gesture. When user touches button it becomes selected and keeps receiving touch-move events. I want to deselect the button on touch-move and pass moves to gesture. How to cancel touch receiving on button "elegantly"? 回答1: You need to implement the UIGestureRecognizerDelegate. Specifically this method. Then just build your logic for deciding if the gesture should receive the touch or not. If you return NO then the touch is up for grabs for the button.