uikit

What does the UITableView method “deleteRowsAtIndexPaths: withRowAnimation:” do?

别等时光非礼了梦想. 提交于 2019-12-12 09:22:06
问题 ********Update to Question********** If the tableview does not affect the model: Are the index path of onscreen cells changed to reflect their actual position OR are the indexes of deleted cells invisible until reloadData is called? *******Original Question********** I know it marks the cells for deletion and animates the deletion, but what does it do to the model? Does it affect the model at all (I can't imagine it does)? Are the cells "still there" but invisible? When the user begins to

Custom animatable property returns NSNull?

丶灬走出姿态 提交于 2019-12-12 08:53:09
问题 Only one day left on the bounty! Can you have a custom animatable property work with the UIView animateWithDuration block syntax? I've been working on creating my own implicit animation for a custom animatable property on a custom CALayer . I have set the backing layer of a custom UIView and can use a CATransaction to animate the custom property (in the custom example I am changing the color of a circle with a custom property circleColor ). I know that UIView turns off animatable properties

UINavigationController - pop animation bug

限于喜欢 提交于 2019-12-12 08:32:07
问题 I have trouble with animation of UINavigationController. I have master-detail view. On view one button, that's open detail view. Detail view opens correctly, with normal animation of header and with sliding of content. But when I click Back button, header animated correctly, and content of detail disappear in moment and not animated. Here is the link on demonstration of problem: https://www.youtube.com/watch?v=C4UApAhEhx8 For opening I use standard AboutViewController *aboutViewController = [

Get decimal separator of decimal pad keyboard on iOS

三世轮回 提交于 2019-12-12 08:26:56
问题 I am trying to find out which decimal separator is used by the decimal pad keyboard in iOS, so I can convert strings entered by the user to numbers with NumberFormatter and back. As I want to pre-fill the text field with an existing value, I need to have a number formatter that uses the same decimal separator as the decimal pad keyboard. The language that my device is set to (German, Germany) uses a comma as the decimal separator. I have configured iOS to have the German keyboard as the

Bad Access on [UICollectionView setCollectionViewLayout:animated:]

不羁的心 提交于 2019-12-12 08:17:28
问题 I'm getting a strange crash in my UICollectionView. The crashing UICollectionView is embedded in an UICollectionView cell of another UICollectionView. I can't reproduce the issue, it seems to happen sometimes if the inner UICollectionView get's newly initialized because the outer CollectionView is reloading it's cells. com.apple.main-thread Crashed 0 libobjc.A.dylib objc_msgSend + 9 1 UIKit -[UICollectionViewData _setLayoutAttributes:atGlobalItemIndex:] + 60 2 UIKit __45-[UICollectionViewData

Adding subviews on top of a programmatically-created UIView hierarchy

非 Y 不嫁゛ 提交于 2019-12-12 08:15:26
问题 I have a UIView subclass that programmatically creates and adds a number of subviews. However, I want to give users of the class the ability to place new subviews over it (and its subviews) using addSubview and ideally from within Interface Builder as well. What is the best way to do this? Now, I suppose it would be acceptable to only add the views programmatically using addSubview, but I'm not sure how I would go about this either. NOTE: I've tried adding additional subviews using interface

Is there a horizontal UIRefreshControl?

与世无争的帅哥 提交于 2019-12-12 08:06:57
问题 You can add UIRefreshControl to UICollectionView (or any UIScrollView for that matter) by adding it to collection's subviews: UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init]; [refreshControl addTarget:self action:@selector(handleRefresh:) forControlEvents:UIControlEventValueChanged]; [self.collectionView addSubview:refreshControl]; This doesn't work when collection view layout has UICollectionViewScrollDirectionHorizontal. I tried overriding layoutSubviews to put refresh

UISearchBar stretches text when it begins editing

余生长醉 提交于 2019-12-12 08:02:34
问题 I have an instance of a UISearchBar added to the title view of a UINavigationBar. When there is text already set and the search bar starts editing it resizes its contents to allow space for the Cancel button, although, the resulting animation stretches the text, as showed in the gif below Is there anything that can be done to avoid this defect effect? I have tried to remove the text and then to add it back a few moments later, although it works, it is not an elegant solution. Update Based on

UITextView NSAttributedString Size

泪湿孤枕 提交于 2019-12-12 07:49:01
问题 I'm working on an app which uses a UITextView. The UITextView should grow or shrink to fit its text, both vertically and horizontally. To do this, I'm overriding sizeToFit in a subclass, and I set the bounds like so: - (void)sizeToFit { [self setBounds:(CGRect){.size = self.attributedText.size}]; } The problem is that this size just doesn't reflect the correct size of the string, as the UITextView clips the text. I'm setting the edge insets to zero, so that shouldn't be an issue right? At

PagingEnabled for multiple pages in UIScrollView

▼魔方 西西 提交于 2019-12-12 06:01:29
问题 Edit: See the answer below. I finally give up and come here to ask you for my problem... I'm using a UIScrollView for a scrolling menus with little icons. On each page, with paging enabled, there's an icon in the center, and 2 and a half other visible icons on the left and right. I can move from one icon to its neighbour, and that is fine, but the point is that if I do a fast scrolling, it will not move from more than 3 icons, which is the width of the screen. What I would want is to be able