Time of Update: 2014-12-01
MBProgressHUDDemo,progress:工程圖:此代碼需要加入第三方庫MBProgressHUD代碼:RootViewController.h#import <UIKit/UIKit.h>//加入標頭檔#import "MBProgressHUD.h"@interface RootViewController : UIViewController<MBProgressHUDDelegate> { MBProgressHUD
Time of Update: 2014-11-28
旋轉的圖片(MainPageViewDemo),:工程圖: 此代碼需要加入第三方庫MainPageView.代碼:RootViewController.h#import <UIKit/UIKit.h>@class MainPageView;@interface RootViewController : UIViewController{ MainPageView* mainPageView;}@property (nonatomic,retain)
Time of Update: 2014-12-01
檢測手機翻轉,手機翻轉代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //監聽手機方向改變事件 [[NSNotificationCenter defaultCenter] addObserver:self
Time of Update: 2014-11-28
中國地圖,中國地圖高清版大圖 :工程圖:在代碼中要加入第三方庫MapDraw.代碼:#import "AppDelegate.h"//加入標頭檔#import "DrawMapViewController.h"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow
Time of Update: 2014-11-28
旋轉的風扇(RoundDisk),旋轉風扇rounddisk:工程圖:此代碼需要加入第三方庫RoundDisk.代碼: #import "AppDelegate.h"//加入標頭檔#import "RoundDiskViewController.h"- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
Time of Update: 2014-11-28
播放gif動畫,gif動畫:工程圖:此代碼需要加入第三方庫GifView.代碼:RootViewController.m#import "RootViewController.h"//加入標頭檔#import "GifView.h"- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. GifView *gifview =
Time of Update: 2014-11-27
ios之開發中使用頻率很高的宏定義-提高裝置螢幕適配以及開發效率// log#define APP_Log(...) NSLog(__VA_ARGS__)// assert#ifdef ENABLE_ASSERT_STOP#define APP_ASSERT_STOP {LogRed(@"APP_ASSERT_STOP"); NSAssert1(NO, @" \n\n\n===== APP Assert. =====\n%s\n\n\n",
Time of Update: 2014-11-26
xcode archive後提示找不到icon,xcodeiconarchive後發現包裡面的有些icon尾碼從png改成tiff了,所以就提示找不到icon.以下是解決辦法: You need to open the project that generates the external resources bundle, select the target, go to Build Settings and then the Deployment sub-heading,
Time of Update: 2014-11-27
ios – 使用UINib載入xib檔案實現UITableViewCellxib檔案的實質是xml,描述介面對象,每個對象都有一個很重要的屬性,identity inspector面板中class屬性,載入xib檔案的時候實際上是執行個體化介面對象相對應的這些class。 xib檔案的載入過程: 1.將xib檔案從磁碟載入記憶體,有兩種技術可以載入xib檔案:NSBundle和UINib。
Time of Update: 2014-11-25
[iOS基礎控制項,ios基礎控制項 需求: 1.點擊按鈕播放相應動畫 2.點擊湯姆貓身體部分(頭、腳、尾巴)顯示動畫 3.當前現正播放動畫不可觸發其他動畫 4.最佳化緩衝、記憶體管理 A.序列幀動畫 #1. png格式的檔案可以不帶副檔名訪問,而且可以放到”Images.scassets”的組中預覽,jpg只能放到support file中了,而且訪問的時候要寫上副檔名 #2.
Time of Update: 2014-11-26
安卓開發中Spinner控制項的使用,安卓spinner 在安卓手機應用開發中,Spinner對象常用方法有以下五種。 用法 1 :以資源方式,靜態展示 Spinner 選項 用法 2 :以代碼方式,動態展示 Spinner 選項 用法 3
Time of Update: 2014-11-25
ios UITextView 提示文本定義兩個UITextView,一個用於輸入文本,一個用於顯示提示資訊,當輸入文本為空白時顯示提示資訊,否則不顯示提示資訊。 //6.3.1文字內容提示 _contentTextViewTip = [[UITextView alloc] initWithFrame:CGRectMake(12, 5, WIDTH_SCREEN - 12 - 12, 105)]; if (_contentTextViewTip !=
Time of Update: 2014-11-21
iOS 中一個tabBarController 切換到另一個tabBarController的實現方法iOS 中主tab(含有5個視圖) 切換到次級tab(含有另外五個視圖) 的使用方法:-(void)makeTabBarHidden:(BOOL)hide{ if ( [self.rootTabBarController.view.subviewscount] return; } UIView *contentView; if (
Time of Update: 2014-11-21
日期時間的選取器ios源碼,選取器ios源碼這個源碼案例是一個日期時間的選取器,源碼DVDatePickerTableViewCell,DVDatePickerTableViewCell是使用Swift寫的cell。可以在tebleView中提供一個日期時間的選取器,並持續顯示在Cell上。:<ignore_js_op> 使用方法:DVDatePickerTableViewCell想平常使用cell那樣使用即可。 var cells:NSArray =
Time of Update: 2014-11-20
iOS多點串連的使用、協議逆向、安全性 什麼是多點串連?多點串連簡單說就是將裝置兩兩進行串連,從而組成一個網路,見:多點串連可以基於如下兩種通道建立: 即:藍芽與WiFi, 且“只具有藍芽的裝置”可以與“只具有WiF的裝置”通訊, 這一切都是透明的,開發人員根本不需要關心:個人感覺它的能力還是比較強大的。 既然能力這麼強大,它可以用來做什麼呢? MC只是提供了一種資料通道,具體用途還是要看業務、看大家的想象力, 下面列幾個比較常見的用途:
Time of Update: 2014-11-20
可自訂的側邊欄菜單ios源碼,自訂ios源碼 這個源碼是可自訂的側邊欄菜單,源碼MDMenuViewController,MDMenuViewController提供使用的側邊欄菜單。功能表項目可自訂,由數組組成。菜單上的文字圖片等完全支援自訂,菜單還支援橫屏。:<ignore_js_op> 使用方法:將整個"MDMenuViewController
Time of Update: 2014-11-20
ios之介面之間的資料正逆向/多層次傳遞方法1 初始化傳值(重寫init方法,讓後面攜帶需要傳入的資料,然後在對介面初始化,使用這種方法必須要在初始化前就已經有資料了比較適合)#import @interface CustomView : UIView// 需要注意必須在 (.h)對方法進行聲明 在外部建立這個類的時候才能看到- (instancetype)initWithFrame:(CGRect)frame withInformation:(NSDictionary
Time of Update: 2014-11-20
iOS 不規則的ImageView我們在做iOS開發的時候,往往需要實現不規則形狀的頭像,如:那如何去實現?通常圖片都是矩形的,如果想在用戶端去實現不規則的頭像,需要自己去實現。1.使用layer去實現, 見http://blog.csdn.net/johnzhjfly/article/details/399933452.使用CAShapeLayer, CALayer如何去實現我們來看看如何使用CAShapeLayer去實現,定義一個ShapedImageView,繼承於UIView,
Time of Update: 2014-11-20
ios開發入門篇(四):UIWebView結合UISearchBar的簡單用法UIWebView是ios開發中比較常用的一個控制項。我們可以用它來瀏覽網頁、開啟文檔等,今天筆者在這裡簡單介紹下UIWebView和UISearchBar結合起來的用法,做一個簡單的類瀏覽器。 一:首先定義這兩個控制項,並在.h檔案中實現UISearchBarDelegate,UIWebViewDelegate兩個代理 @interface TestView :
Time of Update: 2014-11-16
iOS中UIScrollView與UIPageControl 同步變化的方法ghscrollView 與 pageControl 之間的同步變化當處理pageControl相關 的方法時應該先擷取scrollView 再根據pageControl的currentPage來修改scrollView 的位移量 代碼如下- (void)handlePageControl:(UIPageControl *)pageControl { // 1.現擷取scrollView