ios5

UIView shadow not working

為{幸葍}努か 提交于 2020-01-03 07:21:09
问题 This is my code. listView.layer.masksToBounds = NO; listView.layer.shadowOffset = CGSizeMake(-3, 3); listView.layer.shadowColor=[[UIColor blackColor] CGColor]; listView.layer.shadowRadius = 4; listView.layer.shadowOpacity = 1.0; [listView.layer setShouldRasterize:YES]; It works good with shadow effect. While changing listView.layer.masksToBounds = YES; I didnt get shadow effect. 回答1: The shadow is actually drawn below the UIView. If you set maskToBounds to YES, this clips any drawing outside

Removing cancel button in UIImagePickerController?

陌路散爱 提交于 2020-01-03 05:26:08
问题 I am developing an app for ios 5. I need to remove the cancel button on UIImagePickerController i searched for this problem on the forum but didnt get exact answer can someone please help me with this? 回答1: That is because it is not possible to remove that cancel button. That is an inbuilt function and you can not make changes in the same. 回答2: I will give the best method to achieve this: First create a subclass of the UiImagePickerController in the subclass respond to the

How to change shape of an image using iPhone SDK?

久未见 提交于 2020-01-03 05:14:17
问题 I am creating an iPhone app in which I want to give the user the ability to change shape of a given image as shown below. How can I achieve that? Please let me know. 回答1: SPUserResizableView is a user-resizable, user-repositionable UIView subclass. It is modeled after the resizable image view from the Pages iOS app. Any UIView can be provided as the content view for the SPUserResizableView. As the view is respositioned and resized, setFrame: will be called on the content view accordingly.

How to pass data from one View Controller to another in a Storyboard when going back?

…衆ロ難τιáo~ 提交于 2020-01-03 05:08:11
问题 Scenario: Storyboard with UINavigationController as initial controller. MainVC (navigation controller's root vc) needs the user to choose a location on a map. MainVC pushes a VC containing a MapKit map and adds itself as listener for a notification the MapVC sends out when the user chooses a location. MapKit is a memory hog, we all know that. iOS gives me a memory warning, I do all the things that need to be done, then iOS deallocates all it can deallocate, including the MainVC. MapVC sends

Customizeappearance compatibility on others iOS

大兔子大兔子 提交于 2020-01-03 05:06:12
问题 I did not see an answer to my question yet so I ask it : I am currently using (void)customizeappearance to customize the design of my tabbar and navbar. Will that function restrain the use of my app to iOS5-based iPhone only ? If not, will my bars be seen the same in all devices ? Thanks in advance. Here is the method I am using : - (void)customizeAppearance { UIImage *tabBackground = [[UIImage imageNamed:@"bg_tab"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; [[UITabBar

Unable to switch views programmatically using a storyboard?

空扰寡人 提交于 2020-01-03 04:56:08
问题 I am developing a storyboard-based application, using XCode 4.2. I'm new to storyboards, before that I used to switch views by creating a new instance of a class like this: if (x==1) { theClass *theView ; theView= [[theClass alloc] initWithNibName:nil bundle:nil]; [theView setText:theText]; [reader presentModalViewController:theClass animated:YES]; //where reader is an instance of the ZBar library } With storyboards, here is the code I am trying: if (x==1) { [self performSegueWithIdentifier:

NSFetchedResultsController does not update TableView after UIManagedDocuments gets new data

限于喜欢 提交于 2020-01-03 03:34:13
问题 I am using a NSFetchedResultsController in combination with a UIManagedDocument which gets updated in an background thread. I have set up the NSFetchedResultsController exactly as described in this tutorial: How To Use NSFetchedResultsController I have set the delegate _fetchedResultsController.delegate = self and the protocol for my view controller to NSFetchedResultsControllerDelegate . My code works fine when it loads the data after launch. However, the NSFetchedResultsController does not

setBackgroundImage for UIBarButtonItem via appearance not working for other UIControlStates

本秂侑毒 提交于 2020-01-03 03:29:05
问题 I'm trying to customize a UIBarButtonItem using the appearance method (>iOS 5.0). It works fine for the UIControlStateNormal, but not for highlighted or disabled. See images Here's the code I use to set those: // now configure the UIBarButtonItems UIImage *buttonBGInactive = [[UIImage imageNamed:@"button-navbar-30-inactive.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 15, 0, 15)]; UIImage *buttonBGActive = [[UIImage imageNamed:@"button-navbar-30-pressed.png"]

Class files of Obj-C “@interface”? [duplicate]

北慕城南 提交于 2020-01-03 01:41:20
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Difference between @interface definition in .h and .m file Obj C class files have two files .h and .m ,in which the .h holds interface definition (@interface) and .m holds its implementation (@implementation) But i saw in some classes there is an @interface occurring in both .h and .m? What is the need for the @interface in both files?Is there any specific reason to do so?And what are the advantages if did so?

Does iOS support Bluetooth SPP?

核能气质少年 提交于 2020-01-03 01:34:24
问题 I want to develop an ios application that communicates with another bluetooth supported device via Bluetooth SPP. Does iOS support SPP? I checked iOS supported profiles bu couldn't see anything about SPP.. http://support.apple.com/kb/ht3647 So, is there any other way for using SPP ? Thanks.. 回答1: No, unfortunately Apple (iOS) Bluetooth does not support SPP. In order to make a serial cable communication to an iOS Device you have to use the Authentication CoProcessor. I guess from that reason,