uikit

How do I notify system when supportedInterfaceOrientations changes?

一曲冷凌霜 提交于 2019-12-21 07:08:59
问题 My root view controller's implementation of supportedInterfaceOrientations almost always returns UIInterfaceOrientationMaskAll , however there is one edge case where it returns UIInterfaceOrientationMaskLandscape . This is working, if the user rotates the device. However if the device is being held in portrait mode the supportedInterfaceOrientations method does not ever get called, unless the user manually rotates the device. How can I programatically tell the system that the return value of

Move views accordingly uivew collapse/expand animation

元气小坏坏 提交于 2019-12-21 06:34:40
问题 I have a custom View banner that has expand/collapse animation, something like described here iphone: expand and collapse a UIView programmatically . What I want that when I integrate that view to any my existing View Controllers, when it get expanding to push down existing views. Now it's just overlaps. How can I accomplish that in iOS? In Android I have done it using Visibility.Gone , but here I wasn't able to find anything like that. Banner can be in any view hierarchy , directly child of

Hide Shutter in UIImagePickerController

强颜欢笑 提交于 2019-12-21 05:23:10
问题 I have designed an iris shutter animation for a camera view in an iPhone app. Unfortunately, it seems impossible to hide Apple's shutter when the view appears, even if I hide the camera controls and create a custom cameraOverlayView. I have gotten around this by animating my shutter on top of the normal shutter when the view appears, using the viewWillAppear and viewDidAppear methods of UIImagePickerController. However, I can't get the shutter to be hidden under my shutter the first time

How can I animate a UIButton Alpha property with MonoTouch

旧城冷巷雨未停 提交于 2019-12-21 05:05:38
问题 I have a simple UIButton with an Alpha property that I would like to animate from 1.0f to 0.0f, and then back to 1.0f. This is basically responding to TouchDown. Also, is there anything special I need to do if the routine I am calling from is not on the main thread (async delegate invoked on the ThreadPool)? Should I use CAAnimation? Thanks! 回答1: Unless someone pipes up with a mono way to do it, I say use: - (void) pulseButton { button.alpha = 0.0; [UIView beginAnimations:nil context:button];

CALayer performance vs. UIImageView performance

若如初见. 提交于 2019-12-21 04:49:07
问题 I'm noticing that some of the things that I do with images in my app, I could be doing with CALayer properties instead (i.e. borders, shadows, gradients, and so on). So I'm wondering, in general, is it a better idea to use CALayers and such, or just do all that stuff in photoshop and use UIImage(View)s for whatever I need? Scrolling performance has been kinda slow with drop shadows and stuff, so I'm basically trying to find every little optimization that I can. Background information: I'm

How to make UISlider default thumb to be smaller like the ones in the iOS control center

女生的网名这么多〃 提交于 2019-12-21 04:10:55
问题 I'm working on an app and I have a custom UISlider . However, I'm having some issues on how to make the default thumb to appear smaller like the ones in the iOS control center. Note that I want the same iOS thumb, not a custom thumb image. So far, I've tried thumbRect(forBounds...) but no luck. Any suggestions? 回答1: You can't change the size of the default thumb image, but UISlider has a method setThumbImage(_:for:) that will allow you to pass a similar, smaller image. In your view controller

UISlider ignores alpha when set to 0.5

人走茶凉 提交于 2019-12-21 03:57:38
问题 Why does the UISlider view ignore the alpha view when set to 0.5? Code: for (int i = 0; i < 3; i++) { UISlider *slider = [[[UISlider alloc] initWithFrame:CGRectMake(0, i * 30, 200, 30)] autorelease]; slider.alpha = 0.4 + (CGFloat)i / 10.0f; [window addSubview:slider]; } Result: The sliders have alpha values 0.4, 0.5 and 0.6. And as you can see the middle one with 0.5 is completely opaque. It seams to only occur with alpha 0.5. Have tested other UI controllers and they work as expected with

Handling AutoLayout constraint animation differences in iOS 10?

馋奶兔 提交于 2019-12-21 03:11:22
问题 I've noticed that in iOS 10 Beta 5 (about to try Beta 6), AutoLayout constraint animation behaves a bit differently. For example, this approach does not work the same as it did in previous iOS releases: [view addConstraints:@[constraints...]]; [view setNeedsUpdateConstraints]; [view layoutIfNeeded]; [UIView animateWithDuration:... { /* adjust constraint here... */ [view layoutIfNeeded]; // Only the adjusted constraints since previous layoutIfNeeded() call should animate change with duration.

How to animate image in tableview to extend and open another view controller simultaneously?

独自空忆成欢 提交于 2019-12-21 03:10:36
问题 I'm making a messenger app and I want the user to click on image in my tableview and it should extend to full screen and show different controls on navigation bar. How do I go about it? I thought I can take the same image, put UIImageView on top of original cell image and animate it to full screen. But how do I go about presenting different controller without blinks, delays, and animations? This is done in many messaging applications. 回答1: Use a custom transition, to extend the image view

Syncing the scroll position of multiple UITableView instances

别说谁变了你拦得住时间么 提交于 2019-12-21 02:50:11
问题 I have a project in which I need to display multiple UITableView instances inside the same view on the iPad. They also happen to be rotated, but I'm fairly certain this is irrelevant. The user should be unaware that the view is made up of multiple table views. Therefore, I'd like to make it so that when I scroll one tableview, the others scroll with it at the same time. Because UITableView is a subclass of UIScrollView , I figured I could handle UIScrollViewDelegate methods and pass them