An interactive processing method for iPhone design when loading cameras

Source: Internet
Author: User

What should I do if I enable the camera and perform human-computer interaction during the iPhone application?

Let's talk about a method that we use first. This is useful for a single application, that is, to directly enable the camera in *** appdelegate. The specific method is to define the direction of a uiimagepickerviewcontroller in the application proxy and then display it to the window. The details are as follows (it should be noted here that walktextviewcontroller inherits from uiimagepickerviewcontroller to hide certain control key areas on uiimagepickerviewcontroller ):



Extends textappdelegate. h


@ Class extends textviewcontroller;
@ Interface into textappdelegate: nsobject <uiapplicationdelegate> {
Uiwindow * window;
Extends textviewcontroller * viewcontroller;
Uinavigationcontroller * navigationcontroller;
}

@ Property (nonatomic, retain) iboutlet uiwindow * window;
@ Property (nonatomic, retain) iboutlet extends textviewcontroller * viewcontroller;
@ Property (nonatomic, retain) iboutlet uinavigationcontroller * navigationcontroller;


Extends textappdelegate. m


-(Void) applicationdidfinishlaunching :( uiapplication *) Application {

// Override point for customization after app launch

[Window addsubview: viewcontroller. View];
[Window addsubview: [navigationcontroller view];
[Window makekeyandvisible];
}

 

In this way, you can solve some memory release problems. Next we will look at a way of processing in integration. We also use
Extends textviewcontroller. The processing method is similar to the above. Specifically, the following code is added to viewdidload:

 

Imagepicker = [[using textviewcontroller alloc] init];
Imagepicker. sourcetype = uiimagepickercontrollersourcetypecamera;
Imagepicker. showscameracontrols = no;
Self. navigationcontroller. View. backgroundcolor = [uicolor clearcolor];
Self. View. backgroundcolor = [uicolor clearcolor];
[[Uiapplication sharedapplication]. keywindow addsubview: imagepicker. View];

 

Here
Imagepicker is used
Defined by walktextviewcontroller.

Of course, we can make a view to implement all the operations and set its transparency. Then, we can add this view to the view of the object defined by uiimagepickerviewcontroller.

Okay, that's it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.