錄影檔:
1.http://youtu.be/xRd8uBle5hw Animals1(tableView)
2.http://youtu.be/9_jPfdx3xJw Animals2 (tableView)
3.http://youtu.be/fSThCdis6mg Animals3 (tableView)
4.http://youtu.be/xkLpM5sTvG0 Systemsound1
5.http://youtu.be/XbrhO_Ku-Tk Systemsound2
6.http://youtu.be/UKrN80SDWzI Play MP3
7.http://youtu.be/hAAGqV04y1Y Play MP3
8.http://youtu.be/tr2aBne9zyU MagicMic
9.http://youtu.be/pteJdt_0qAo MagicMic
2013年11月27日 星期三
2013年11月25日 星期一
2013年11月21日 星期四
【職訓局-手機程式開發班】2013 11/21 Xcode
錄影檔:
在終端機上輸入:
> sqlite3 account.sqlite
2.將建立的sql檔案拖到xcode專案中*注意下方的add to targets的contacts要打勾
3.下載FMDB 網址https://github.com/ccgus/fmdb
4.將下載好的解壓縮,裡面有個src將他拖到xcode專案中(fmdb.m不用)
5.剛開始時要確定自己建立的資料庫是否複製到app中
6.基本資料庫連線:先import "FMDatabase.h"
1.http://youtu.be/ESeGDjZxuaQ 介紹xcode系統檔案
2.http://youtu.be/f9jpX_exins filemanager1
3.http://youtu.be/B7XGTERepq8 filemanager2
4.http://youtu.be/pjjuC7l3wOQ filemanager2
5.http://youtu.be/JfYOvbo1ttQ SQLite
6.http://youtu.be/JPSSgqOMPa0 SQLite
7.http://youtu.be/jwBWgvi69Fc SQLite
8.http://youtu.be/ruTPwyeT6ZM SQLite
9.http://youtu.be/w1aIIu1AWRU SQLite
10.http://youtu.be/XX2tDIHz4og UIScrollView
11.http://youtu.be/Ug523TPQfIE TableView1
SQLite使用:
1.建立SQLite資料庫5.http://youtu.be/JfYOvbo1ttQ SQLite
6.http://youtu.be/JPSSgqOMPa0 SQLite
7.http://youtu.be/jwBWgvi69Fc SQLite
8.http://youtu.be/ruTPwyeT6ZM SQLite
9.http://youtu.be/w1aIIu1AWRU SQLite
10.http://youtu.be/XX2tDIHz4og UIScrollView
11.http://youtu.be/Ug523TPQfIE TableView1
SQLite使用:
在終端機上輸入:
> sqlite3 account.sqlite
2.將建立的sql檔案拖到xcode專案中*注意下方的add to targets的contacts要打勾
3.下載FMDB 網址https://github.com/ccgus/fmdb
4.將下載好的解壓縮,裡面有個src將他拖到xcode專案中(fmdb.m不用)
5.剛開始時要確定自己建立的資料庫是否複製到app中
在輸入:
先安裝好firefox 在下SQLite Manager
安裝好就可以在工具找到SQLite Manager
再按開啓.sqlite檔案就能管理
UIScrollView使用:
1.設定outlet及protocol
@interface ViewController : UIViewController<UIScrollViewDelegate>
@property (strong, nonatomic) IBOutlet UIScrollView *scrollview;
2.程式部分
- (UIView *) viewForZoomingInScrollView:(UIScrollView *)scrollView {
return scrollView.subviews[0]; // 設定可以縮放的目標
}
- (void)viewDidLoad
{
[super viewDidLoad];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"picas.jpg"]]; // 建立UIImageView 並設定圖片
[self.scrollview addSubview:imageView]; // 將imageView 加入scrollview中
self.scrollview.minimumZoomScale = 0.5f; // 設定最大縮小倍率
self.scrollview.maximumZoomScale = 5.0f; // 設定最大放大倍率
self.scrollview.contentSize = imageView.bounds.size; // 設定scrollview的範圍
self.scrollview.delegate = self; // 設定代理者
}
TableView使用:
1.建立tableView:可剛開始就新增也可後來自己拉出tableView
2.設定內容
- (void)viewDidLoad
{
[super viewDidLoad];
prices = @[@"NT$350",@"NT$400",@"NT$300",@"NT$250"];
titles = @[@"book1",@"book2",@"book3",@"book4"];
UIImageView *imageView1 = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"footer.png"]]; // 設定標題圖片
imageView1.contentMode = UIViewContentModeScaleAspectFit; // 讓圖片不會變形
self.tableView.tableFooterView = imageView1;
UIImageView *imageView2 = [[UIImageView alloc]
initWithImage:[UIImage imageNamed:@"header.jpg"]]; // 設定頁尾圖片
imageView2.contentMode = UIViewContentModeScaleAspectFit; // 讓圖片不會變形
self.tableView.tableHeaderView = imageView2;
}
3.加入內容
- (UITableViewCell *) tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier =
@"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// 加入內容
cell.imageView.image = [UIImage imageNamed:
[NSString stringWithFormat:@"book%d.jpeg",indexPath.row+1]]; // 設定row的圖片
cell.imageView.contentMode = UIViewContentModeScaleAspectFit; // 讓圖片不變形
cell.textLabel.text = titles[indexPath.row]; // 將陣列文字放入
cell.detailTextLabel.text = prices[indexPath.row]; // 將陣列裡價格放入
return cell;
}
訂閱:
文章 (Atom)