uiview

Flickering animation with UIViewAnimationTransitionFlip

我怕爱的太早我们不能终老 提交于 2020-02-23 06:48:10
问题 I have a containerview with 2 subviews. I want to flip from one to another. The problem is that some kind of flickering appears. It doesn't happen on the iPhone 3GS, but on the Simulator and the iPhone 3G: http://www.hanspinckaers.com/upload/Flickering.png Does anyone know why this happens? This is the code: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 0.75]; [UIView setAnimationDidStopSelector:@selector(afterAnimationProceed)]; [UIView setAnimationDelegate:self];

Flickering animation with UIViewAnimationTransitionFlip

南楼画角 提交于 2020-02-23 06:48:05
问题 I have a containerview with 2 subviews. I want to flip from one to another. The problem is that some kind of flickering appears. It doesn't happen on the iPhone 3GS, but on the Simulator and the iPhone 3G: http://www.hanspinckaers.com/upload/Flickering.png Does anyone know why this happens? This is the code: [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 0.75]; [UIView setAnimationDidStopSelector:@selector(afterAnimationProceed)]; [UIView setAnimationDelegate:self];

Missing Argument for parameter ‘coder’ in call

会有一股神秘感。 提交于 2020-02-22 05:35:33
问题 I have coded a custom UIButton as : class AccountOpeningButton: UIButton { required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) ...... } } I am able to instantiate this Class successfully using my Storyboard. Now, i made a UIView & want to add this button in my UIView as : var customView:UIView = UIView() customView.frame = CGRect(x: 0, y: 0, width: 350, height: 250) ..... let fromDateBtn:UIButton = AccountOpeningButton()//Error comes here as : Missing Argument for parameter

Core Graphics coordinate system

霸气de小男生 提交于 2020-02-21 10:22:06
问题 When overriding drawRect I've found that the coordinates there use 0,0 as the upper left. But the Apple UIView Programming Guide says this: Some iOS technologies define default coordinate systems whose origin point and orientation differ from those used by UIKit. For example, Core Graphics and OpenGL ES use a coordinate system whose origin lies in the lower-left corner of the view or window and whose y-axis points upward relative to the screen. I'm confused; are they talking about something

YAJL memory leak problem array

余生颓废 提交于 2020-02-07 06:46:31
问题 I am trying to fetch JSON data every 2 seconds and pass it to another class for processing, everything works fine but the below code seems to have memory leaks (from Instruments) but I cannot figure out what is wrong and how I can fix, can someone please advise ??? * Updated with the full logic and it looks like the array that is passed on to the main method is leaking and Instruments is falsely reporting that as YAJL leak..(not very sure thou) * @property (nonatomic,retain,readwrite)

How do I draw an NSAttributedString rotated around a specific point?

二次信任 提交于 2020-01-30 08:17:05
问题 I'm woking on a project were I have to draw strings of text in a UIView. The problem is not drawing the Strings, but rotating them. I want the text to be drawn just above and at the same angle as the red line. Check illustration below: illustration example: Here is the code... (PS. All irrelevant code is removed) class DrawView: UIView { override func draw(_ rect: CGRect) { let context = UIGraphicsGetCurrentContext()! // Adding a line here. context.move(to: CGPoint(x: 290, y: 650)) context

iPhone SDK - How to disable the volume indicator view if the hardware buttons are pressed?

醉酒当歌 提交于 2020-01-29 03:19:28
问题 Is there a way to prevent the volume indicator view form showing if you press the volume up/down hardware buttons? It's needed for a demo app only. So the method don't need to be App Store safe. 回答1: IIRC, the presence of a MPVolumeView inhibits the display of the volume indicator overlay. Try sticking it the relevant view and seeing if this is the case. Then you can try various tricks to make it effectively invisible: Make it hidden (or make a superview hidden). Set its alpha (or the alpha

iPhone SDK - How to disable the volume indicator view if the hardware buttons are pressed?

帅比萌擦擦* 提交于 2020-01-29 03:19:04
问题 Is there a way to prevent the volume indicator view form showing if you press the volume up/down hardware buttons? It's needed for a demo app only. So the method don't need to be App Store safe. 回答1: IIRC, the presence of a MPVolumeView inhibits the display of the volume indicator overlay. Try sticking it the relevant view and seeing if this is the case. Then you can try various tricks to make it effectively invisible: Make it hidden (or make a superview hidden). Set its alpha (or the alpha

Find Frame Coordinates After UIView Transform is Applied (CGAffineTransform)

空扰寡人 提交于 2020-01-27 04:50:13
问题 I rotate my view with CGAffineTransform [view setTransform:newTransform]; The frame values remain the same after transform is applied but how do I find "rotated" or transformed values of this frame? (source: informit.com) I want the exact coordinates of rotated frame edges, that is a, b, c, d points. 回答1: One thing to keep in mind is that the transform changes the coordinate system, so you will need to be able to convert between the parent 'view' and the child (transformed) view. Also,

How do I reuse a view inside UIPickerView in this case?

感情迁移 提交于 2020-01-25 10:14:38
问题 It seems that a lot of people just return a UILabel, but in my case I'm adding a label to a view. The view is never not nil. This is a different use of UIPickerView, because I'm rotating its components 90 degrees and having it scroll sideways instead of up and down. func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView { if view == nil { let customWidth = 300 let customHeight = 300 let view = UIView(frame: CGRect(x:0, y