uikit

iPhone: Putting only one section of UITableView in Edit mode

a 夏天 提交于 2019-12-22 04:14:37
问题 I have three sections in my hypothetical UITableView. I'd like one section that is in editing mode. The rest of the sections to not be in editing mode. Is this possible at all? 回答1: This really shouldn't be a mystery, as it's spelled out clearly in the documentation. Simply use the datasource method - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath 回答2: This worked great for me. In the example below section 0 is not editable whilst the other sections

UIAppearance's “when not contained in”

心不动则不痛 提交于 2019-12-22 02:56:18
问题 I am currently spinning a complex web of UIAppearance modifiers*, and have come across a problem. My usage of FlatUIKit's custom UIBarButton appearance protocol is causing MFMailComposerViewController to complain and stop working. Therefore, instead of using UIAppearance 's whenContainedIn method to specify classes that cause modification to occur, is there a way to exclude certain classes, i.e. a "when not contained in"? * I am talking about the UIAppearance protocol that is used to

Is there any way to modify a UITableView's separator cell?

一个人想着一个人 提交于 2019-12-22 01:31:41
问题 My app will be using slightly thicker separator lines in tableViews - about 3x the thickness. I have already done this in some areas by setting separatorStyle to none and customizing cell backgroundViews with custom backgrounds that include my thick separator. The issue with this method is that it only applies to real rows. Thus if I have a tableView that fills the whole screen but only has two rows, then only the two rows will have the custom separators. The workaround I've been using is to

CAGradientLayer and scrollViewTexturedBackgroundColor

我怕爱的太早我们不能终老 提交于 2019-12-22 00:44:17
问题 I'm trying to use CAGradientLayer to fade foreground controls against the background textured view. So in a nutshell, I have a view with the bg color as scrollViewTexturedBackgroundColor. I have a view on top of that, whose contents I'd like to fade at the border into the background view's color. CAGradientLayer* gradient = [CAGradientLayer layer]; gradient.frame = self->scrollableCanvas.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor scrollViewTexturedBackgroundColor]

What is the proper way to make it so core graphics does not lag?

痞子三分冷 提交于 2019-12-22 00:35:32
问题 I use UIBezierPath for finger painting (my app). I create it using path = [UIBezierPath bezier path]; . It constantly lags on the iPad (and calling it from within drawrect did not change anything). I have been working on this for hours on end and have found no solution, just lag. Would somebody be so kind to help me please? Also, I am using a NSTimer to call the function. That is the old way my app will work so please help me fix this lagggg!!!!! 回答1: Since none of your questions contains

CIFaceFeature Bounds

不问归期 提交于 2019-12-22 00:29:27
问题 While doing face detection work with CIFaceFeature , I ran into an issue with the bounds. While trying to put a box around the recognized face, the frame would always be misplaced. Other questions on Stack Overflow point out that the Core Image and UIKit coordinate systems are inverted. CoreImage Coordinate System UIKit Coordinate System (These images are from https://nacho4d-nacho4d.blogspot.com/2012/03/coreimage-and-uikit-coordinates.html) Obviously, this coordinate system difference is the

Animate UITableViewCell ContentView to fade upon entering Edit Mode

拥有回忆 提交于 2019-12-21 22:05:29
问题 I've noticed this functionality in the iPhone Mail.app and SMS.app apps, but I'm unsure how to implement it myself. In a standard UITableView, when a user taps the 'Edit' button and the deletion buttons move into position, as the content views are sliding to the right, they perform a quick fade transition where they are replaced by thinner versions of themselves (to account for the space the deletion button is taking up). I initially thought this was done by calling the following method when

Make a deep copy of a UIView and all its subviews

喜你入骨 提交于 2019-12-21 20:52:53
问题 I need to make a deep copy of a UIView containing several subviews. Please help me figure out how to do this? I've done some searching on google and SO and not found anything that does what I want. Explanation for those who would like to know why: I have an infinitely scrolling UIScrollView where, of course, the contents repeat. Each 'set' of the contents (for example, say 26 UIButtons labeled A-Z) is contained inside one view. This is the view I need to make a deep copy of, so that I can

why does viewDidAppear not get triggered?

佐手、 提交于 2019-12-21 20:29:51
问题 i have a root view controller that inserts a subview at index 0 at its viewDidLoad method. i am trying to get the subview to become firstResponder, but can only do this - from my understanding - in the subview's viewDidAppear method. here's the line of code i added to the root view controller's viewDidLoad method: [self.view insertSubview: subViewController.view atIndex: 0]; the subviewcontroller has a xib, subViewController.xib, that is shown correctly at runtime. nevertheless, the

Modal view controller size with master-detail controller

会有一股神秘感。 提交于 2019-12-21 20:27:08
问题 My app has a split master-detail interface: when the user hits a particular button in the detail side of the screen, I use a UIModalTransitionStyleFlipHorizontal modalTransitionStyle so that I can just present a new controller modally and have it appear as if the details panel has "flipped" to the new interface. While this works fine on the iPhone, when I try it on the iPad, the new modal controller flips from the details side of the screen but at the end of the animation, it's covering the