uikit

Customize UISegmentedControl on iOS 8

女生的网名这么多〃 提交于 2020-01-02 07:31:15
问题 iOS 7 and 8 seem to make the old ways of customizing UISegmentedControl not work entirely. I've been setting the divider images and everything like I always have in the past, but it appears that there are some new states that didn't exist in previous iOS versions, and as a result there are some weird visual effects. Here's the code that I'm using // Set divider images self.setDividerImage(UIImage(named: "SegmentedControlNoneSelected"), forLeftSegmentState: .Normal, rightSegmentState: .Normal,

Why won't my UIActivityIndicatorView stop animating?

早过忘川 提交于 2020-01-02 07:06:32
问题 I am trying to manage the activity indicator from my App Delegate, that way any of my views can put the indicator up. So, I am adding it as a subview to 'window' and start/stop as follows: - (void)didStartActivity { if( activityIndicator == nil ) { activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge]; activityIndicator.hidesWhenStopped = YES; activityIndicator.center = window.center; activityIndicator.transform =

EKCalendarChooser multiple selection does not work

丶灬走出姿态 提交于 2020-01-02 06:49:44
问题 I'm trying to use EKCalendarChooser to get multiple calendars selected by the user. This is how I present the view: EKCalendarChooser* dvc= [[[EKCalendarChooser alloc] initWithSelectionStyle:EKCalendarChooserSelectionStyleMultiple displayStyle:EKCalendarChooserDisplayAllCalendars eventStore:eventStore] autorelease]; dvc.selectedCalendars= self.selectedCalendars; dvc.delegate= self; dvc.contentSizeForViewInPopover= CGSizeMake(320.0, 480.0); self.popOver= [[UIPopoverController alloc]

Why use Cocos over UI Kit for a 2D iPhone game?

余生颓废 提交于 2020-01-02 06:25:33
问题 I have been building a game in cocos for a while now I it has just occurred to me that it might just be a whole lot easier to use UIKit. Could you please help me weight up the pros and cons, and share some experiences you have. Here is my basic list of advantages for each. I feel I dont know enought about cocos to make a informed decision which is best. Cocos Game engine comes for free. Pause / resume callbacks every frame Sprite animations Uses open GL (is this true? is this an advantage?) .

Is it possible to make UILabel with non-English characters green when Color Blended Layer is enabled?

老子叫甜甜 提交于 2020-01-02 03:37:13
问题 I have a table view with custom cells and I try to optimize it by making all subviews inside the cells in green color when Color Blended Layer is checked in the simulator. When the background of an UILabel in the cell is set to white: let title = UILabel() contentView.addSubview(title) title.background = UIColor.whiteColor() title.text = "Hi, how are you?" This UILabel subview will become green color in the simulator, which is good. However, if I change the text to some Chinese: title.text =

Customize Keyboard in tvOS

放肆的年华 提交于 2020-01-02 02:54:07
问题 I use UISearchController to search inline with keyboard, textfield and results in one screen. Does tvOS allow to customize keyboard? I want to use dark design, but I don't know how to customize the keyboard. For example YouTube app did that. They have black screen with white keyboard 回答1: A UISearchController has a UISearchBar , which conforms to UITextInputTraits . This means it has a keyboardAppearance which you can set to UIKeyboardAppearanceDark to get a dark keyboard appearance. This isn

Core Graphics Line drawing and deleting on touch

孤人 提交于 2020-01-02 00:32:27
问题 I am writing an iPhone application somewhat like pick up sticks app on appstore. I have already done with drawing multiple lines and displaying it using CoreGraphics. But now I am stuck with how to delete the line when the user taps on it. I have searched on Google a lot but didn't find anything related. I have seen this post of yours at some other place and this has really helped me out. but the problem is that if i have a stick and then another stick on top of it. when i click on the stick

Memory Leak in UIKit (not my code) in iOS app?

随声附和 提交于 2020-01-01 21:59:52
问题 I'm trying to solve a memory leak in my iOS app and struggling. I'm using the leaks tool to try to isolate the problem. To my surprise, the leak seems to be happening 100% within the UITableView gesture recognizer code. Specifically, the leak count increments each time I stop scrolling (release) the UITableView. Even weirder, this happens with a UIWebView as well. And with a UIScrollView. So each time I release a drag action on any of these UIKit objects, I get a memory leak. The UI pieces

How can I show a sequence of buttons highlighting?

為{幸葍}努か 提交于 2020-01-01 20:36:12
问题 Similar to the Simon games of old, I want to show the user a button sequence & then have them repeat it back. The place I'm stuck is showing the first button highlighted for, say, 500ms, waiting 100ms, showing the second highlighted for 500ms, waiting another 100ms, showing the 3rd & so on. From other Stackoverflower'ers I've gotten to this block: redButton.highlighted = YES; [UIView beginAnimations:@"" context:nil]; [UIView setAnimationStartDate:[NSDate dateWithTimeIntervalSinceNow:1]];

UIButton Semi-Transparent Border

回眸只為那壹抹淺笑 提交于 2020-01-01 19:23:12
问题 I have a custom button and the border is supposed to be semi-transparent white. If I do this: - (void) awakeFromNib { self.layer.cornerRadius = 6.0f; self.layer.borderWidth = 4.0f; self.layer.borderColor = [[UIColor colorWithWhite:1.0f alpha:0.5f] CGColor]; } I get this - transparency but of the original button color: The border is semi-transparent but the color of the button. 回答1: Set the color of a sublayer to the color you want the button to be (don't set the background color of the button