Android program Development to the background map plus moving gestures _android

Source: Internet
Author: User
Tags uikit

One, engineering drawings.


Second, the effect of the picture.


Three, code.

RootViewController.h

#import <UIKit/UIKit.h>
@interface Rootviewcontroller:uiviewcontroller
< Uigesturerecognizerdelegate>

Rootviewcontroller.m

#import "RootViewController.h" @interface Rootviewcontroller () @end @implementation Rootviewcontroller-(ID) Initwithnibname: (NSString *) Nibnameornil Bundle: (NSBundle *) Nibbundleornil {self = [super Initwithnibname:
Nibnameornil Bundle:nibbundleornil];
if (self) {//Custom initialization} return self; 
}-(void) viewdidload {[Super viewdidload];//Do any additional setup after loading the view.//Add background image [self addview];} #pragma-mark-functions//Background image-(void) AddView {//Red background UIView *parentview=[[uiview Alloc]initwithframe:cgrectmake (50,
100, 200, 200)];
Parentview.backgroundcolor=[uicolor Redcolor];
[Self.view Addsubview:parentview];
[Parentview Setuserinteractionenabled:yes]; Moving gestures Uipangesturerecognizer *panrcognize=[[uipangesturerecognizer alloc] initwithtarget:self action: @selector (
Handlepan:)];
panrcognize.delegate=self;
[Panrcognize Setenabled:yes];
[Panrcognize delaystouchesended];
[Panrcognize Cancelstouchesinview];
[Parentview addgesturerecognizer:panrcognize]; } #pragMa Uigesturerecognizer Handles-(void) Handlepan: (Uipangesturerecognizer *) recognizer {NSLog (@ "--moving gesture-----"); void) didreceivememorywarning {[Super didreceivememorywarning];//Dispose of any of the can is recreated.}

The above code is about the Android program development to the background map plus mobile gestures to the full content, I hope to help!

Related Article

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.