最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android程序開發(fā)之給背景圖加上移動的手勢

 更新時間:2016年03月10日 10:12:47   作者:Livia.Chen  
這篇文章主要介紹了Android程序開發(fā)之給背景圖加上移動的手勢 的相關(guān)資料,需要的朋友可以參考下

一,工程圖。


二,效果圖。


三,代碼。

RootViewController.h

#import <UIKit/UIKit.h>
@interface RootViewController : UIViewController
<UIGestureRecognizerDelegate>
@end 

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.
//增加背景圖
[self addView];
}
#pragma -mark -functions
//背景圖
-(void)addView
{
//紅色的背景圖
UIView *parentView=[[UIView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
parentView.backgroundColor=[UIColor redColor];
[self.view addSubview:parentView];
[parentView setUserInteractionEnabled:YES];
//移動的手勢
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(@"--移動的手勢-----");
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}

以上代碼是有關(guān)Android程序開發(fā)之給背景圖加上移動的手勢的全部內(nèi)容,希望對大家有所幫助!

相關(guān)文章

最新評論

苗栗县| 平利县| 安西县| 波密县| 福贡县| 武穴市| 陕西省| 五寨县| 阜阳市| 扎兰屯市| 高碑店市| 龙门县| 勐海县| 封开县| 资阳市| 陆良县| 娱乐| 达拉特旗| 通化市| 阿鲁科尔沁旗| 高淳县| 镇平县| 登封市| 咸宁市| 阳春市| 福建省| 西吉县| 桃园市| 公安县| 高淳县| 威信县| 新泰市| 吐鲁番市| 仲巴县| 林州市| 策勒县| 望谟县| 贵溪市| 普定县| 万荣县| 二连浩特市|