cocoa-touch

Adding CAShapeLayer as sublayer not visible

徘徊边缘 提交于 2020-01-05 08:23:09
问题 I'm having my first experience with CALayers , and am no doubt doing something very simple, very wrong. The below code is in a class extended from a UIView . I am accessing the CALayer of the view, which is fine, and the attempting to attach a sublayer, based on a line drawn by the users touch. (The CGPath ) By setting the background to bright orange, I can see that I'm passing the right CALayer into my function, yet if I try and set the CAShapeLayer *line to orange - I don't seem to be able

Adding CAShapeLayer as sublayer not visible

假装没事ソ 提交于 2020-01-05 08:22:01
问题 I'm having my first experience with CALayers , and am no doubt doing something very simple, very wrong. The below code is in a class extended from a UIView . I am accessing the CALayer of the view, which is fine, and the attempting to attach a sublayer, based on a line drawn by the users touch. (The CGPath ) By setting the background to bright orange, I can see that I'm passing the right CALayer into my function, yet if I try and set the CAShapeLayer *line to orange - I don't seem to be able

CameraOverlayView buttons

北城以北 提交于 2020-01-05 08:21:35
问题 I'm adding a cameraOverlay to my UIImagePickerController, it shows and all but it doesn't register touches. I init a button in the viewDidLoad and a one via IB. Is there some rule that prohibits me from adding a UIButton to a cameraOverlayView and register touches? Thanks 回答1: I had a similar problem, and it turned out that my overlay UIView's frame was not large enough. The clipsToBounds property for a UIView is by default set to NO, which means its subviews are still visible even if they

How to equally distribute UIButtons using Autolayout

纵然是瞬间 提交于 2020-01-05 07:51:11
问题 I just want my buttons to have equal spaces to each other and a fixed trailing and leading space. I am kinda Autolayout noob, so I don't have any clue how to solve this problem. I tried a lot of different configurations but nothing worked as it should. Any ideas how to solve this Issue ? UPDATE In year 2018 StackViews are the answer. 回答1: To lay out several views that are proportionally spaced based on the orientation of a device, create spacer views between the visible views. Set the

Multiple NSMutableArrays, one sorted by Predicate, others reordered relatively

南笙酒味 提交于 2020-01-05 07:37:28
问题 I have a Music App I am developing, and while I'm managing the TableViews, I'm sorting them into Sections. This is usually an easy process, but the with the way I manage I manage the data, it might not be a completely simple task. I know it's not the best way to do it, but as the cell has multiple properties (titleLabel, textLabel, imageView), I store all the data in 3 separate arrays. When organising the songs by title, for section header, I use a predicate to set the titleLabel, so by using

Adding subview leaves gap between subview and navigation bar

亡梦爱人 提交于 2020-01-05 07:32:49
问题 I've got a storyboard with a view wrapped in a navigationcontroller, that has a UI tab bar at the bottom. I dynamically add sub views to this view, but there is always a blank line between the navigation bar and the subview that appears to be the width of a status bar. On each of the subviews that are created on the storyboard I have their Simulated Metrics set to have a bottom bar as a Tab Bar, status bar is set to none, and top bar is set to navigation bar. Below is my code for adding the

Problem about @2X

不想你离开。 提交于 2020-01-05 07:08:34
问题 1.I use below code for take screenshot.is it necessary to change it for high resolution UIGraphicsBeginImageContext(self.view.bounds.size); [self.view.window.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); 2.what does happen if i just use one image with 640*960 resolution for both low and high quality ? (means that don't use image with @2x) 回答1: That will only take normal (320x480) resolution

Question about extensiblity of Cocoa Touch Controls

我的未来我决定 提交于 2020-01-05 06:41:26
问题 I'm new to programming for the iPhone and i'm wondering: how extensible are the various controls? Let's take the button as an example: can i change the background graphic? can i make it grow larger when i press on it? can i change the font? can i use a custom font? can i use a button graphic in place of text? 回答1: In general, yes to all your questions. You can subclass the various UI* classes that make up the Cocoa touch controls just like any other classes, and add your own custom

Question about extensiblity of Cocoa Touch Controls

六眼飞鱼酱① 提交于 2020-01-05 06:41:09
问题 I'm new to programming for the iPhone and i'm wondering: how extensible are the various controls? Let's take the button as an example: can i change the background graphic? can i make it grow larger when i press on it? can i change the font? can i use a custom font? can i use a button graphic in place of text? 回答1: In general, yes to all your questions. You can subclass the various UI* classes that make up the Cocoa touch controls just like any other classes, and add your own custom

iOS - Presenting a UIViewController inside anther UIViewController

 ̄綄美尐妖づ 提交于 2020-01-05 06:40:07
问题 I dont have a very good understanding on the topic, so please bear with me I am trying to display a UIViewController inside another UIViewController. I feel like there aren't enough examples out there. I have read the documentation but being fairly new to iOS I am kind of lost. Here is my problem: I can get the child UIViewController to appear inside the parent UIViewController but the child view is not displaying right. Sorry, I cant post pictures yet. Here is my child - UIViewController.