標籤: 1 - (void)viewDidLoad 2 { 3 [super viewDidLoad]; 4 5 // 向上 6 UISwipeGestureRecognizer *swipe = [[UISwipeGestureRecognizer alloc] init]; 7 // 設定輕掃的方向 8 swipe.direction = UISwipeGestureRecognizerDirectionUp; 9
標籤: 1 // 1.建立手勢辨識器 2 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] init]; 3 // 1.1設定長按手勢辨識器的屬性 4 // longPress.minimumPressDuration = 5; 5 6 // 手指按下後事件響應之前允許手指移動的位移位 7
標籤: 1 #import "NJViewController.h" 2 3 @interface NJViewController ()<UIGestureRecognizerDelegate> 4 @property (weak, nonatomic) IBOutlet UIImageView *iconView; 5 6 @end 7 8 @implementation NJViewController 9 10 - (void)viewDidLoad11 {12
標籤:主控制器的關鍵代碼:一 ViewController.m#import "ViewController.h"#import "ZRPaintView.h"#import "UIImage+ZR.h"@interface ViewController ()- (IBAction)clear;- (IBAction)back;- (IBAction)save;@property (weak, nonatomic) IBOutlet ZRPaintView
標籤:主控制器的關鍵代碼:ViewController.m#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UITextView *textF;@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; //1. 建立一行背景圖 CGFloat
標籤:在這個大冬天裡默默敲著鍵盤,勿噴.今天學習swift過程中,學習到閉包,發現閉包和oc的block中有很多的相同之處,又重新學習了一下並且學習了一些進階點的用法,內容如下:1.block格式說明:(傳回型別)(^塊名稱)(參數類型) = ^(參數列表) {代碼實現};//如果沒有參數,等號後面參數列表的()可以省略例子:void(^demoBlock)() = ^ { NSLog(@"demo Block");};int(^sumBlock)(int,
標籤:一、使用Broadcast Reciver 1.右擊java檔案夾,new->other->Broadcast Receiver後會在AndroidManifest.xml檔案中產生一個receiver項 <?xml version="1.0" encoding="utf-8"?><manifest
標籤:B要傳值給A1.控制器B中要有一個Block:typedef void (^MyBlock)(NSString* str1,NSString* str2);str1和str2裡存放著要傳遞的參數2.還要有一個以Block為參數的方法-(void)chuanzhi:(MyBlock)block{
標籤:IOS開發之ZBarReaderView的使用HOMEABOUTGUESTBOOKCATEGORIESTAGSLINKSSUBSCRIBE當開發IOS程式中需要用到二維碼識別功能的時候,zbar這個開源庫估計會被不少人選擇。但是關於zbar的用法,網上的資料大部分都集中在ZBarReaderViewController這個類的使用上。本人在使用中,發現ZBarReaderViewController這
標籤: 1 // 當手指在view上移動的時候調用 2 - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 3 { 4 5 UITouch *touch = [touches anyObject]; 6 // 0. 擷取上一次的位置 7 CGPoint prePoint = [touch previousLocationInView:self]; 8 9 //
標籤:1、android的四大組件的了大概功能 activity:負責顯示介面,和使用者互動。 service:運行在後台。 content
標籤:在文章《Android程式員從小白到大神必讀資料匯總(一)》裡面介紹了幾篇Android入門和提升效率的技術資料,今天小編收集了5篇進階的資料,趕緊來看看吧!另外,歡迎大家加入工程師博主交流群:391519124,交流部落格經驗和技術一、Android開發相見恨晚的方法和介面 Android開發中,有哪些讓你覺得相見恨晚的方法、類或介面?二、Android 多渠道打包原理和使用 學會安卓 APP 多渠道打包的技巧,讓你的APP開發更高效三、Google Java
標籤://// ViewController.m// text//// Created by 李東旭 on 16/1/22.// Copyright © 2016年 李東旭. All rights reserved.//#import <UIKit/UIKit.h>#import "ViewController.h"// 定義個宏,方便實用,>> 16 的意思是把16進位轉換成2進位後,右移16位(移動掉的直接捨棄)#define
標籤: 1 - (void)drawRect:(CGRect)rect 2 { 3 // 1.擷取上下文 4 CGContextRef ctx = UIGraphicsGetCurrentContext(); 5 6 // 2.建立路徑(一個path就代表一條路徑) 7 // 但凡通過quarzt2d中的帶有create/ copy / retain 方法建立出來的值都必須手動的釋放 8 CGMutablePathRef path =
標籤: 在Android編程的過程中,如果在Activity中某個操作會運行比較長的時間,比如:下載檔案。這個時候如果在主線程中直接下載檔案,會造成Activity卡死的現象;而且如果時間超過5秒,會有ANR報錯。在這種情況下,
標籤:- (void)action:(id)sender{UIButton * button = sender;[button setTitle:@"清理完畢" forState:UIControlStateNormal];NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);NSString *path = [paths
標籤:Android中,可以四給不同層次上開啟硬體加速:1、應用:<application android:hardwareAccelerated="true">2、Activity<activity android:hardwareAccelerated="true">3、WindowgetWindow().setFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
標籤:Android-Classical-OpenSource 項目地址:https://github.com/eterrao/Android-Classical-OpenSource.git不週期性更新,為了以後找起來方便,也希望能方便後人用到:Trinea的OpenProject:強烈推薦的Android 開源項目分類匯總項目地址:https://github.com/Trinea/android-open-project項目說明:Android
標籤: 1 - (void)drawRect:(CGRect)rect 2 { 3 // Drawing code 4 5 // 畫圓, 以便於以後指定可以顯示內容約制 6 CGContextRef ctx = UIGraphicsGetCurrentContext(); 7 8 CGContextAddEllipseInRect(ctx, CGRectMake(100, 100, 50, 50)); 9 10 //
標籤:轉自:http://xiechengfa.iteye.com/blog/1044721 一些常見的Android面試基礎題做下總結,看看你能做出多少道? 1. Intent的幾種有關Activity啟動的方式有哪些,你瞭解每個含義嗎? 這裡Android123提示大家,Intent的一些標記有FLAG_ACTIVITY_BROUGHT_TO_FRONT