成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

iOS源碼下載:實現自定義畫圖功能

移動開發
實現了可自定義的畫圖功能,可以動態選擇圖筆的顏色,線條粗細等。

支持平臺:iOS

運行環境:iOS

開發語言:Object-c

開發工具:Xcode

源碼大?。?66.12KB

源碼下載地址:http://down.51cto.com/data/1975550

源碼簡介

實現了可自定義的畫圖功能,可以動態選擇圖筆的顏色,線條粗細等。

源碼運行截圖

效果圖

源碼片段

  1. - (id)initWithFrame:(CGRect)frame afterToolColor:(ToolColorBlock)toolcolor 
  2.     _toolColorBlock = toolcolor; 
  3.     self = [super initWithFrame:frame]; 
  4.     if (self) { 
  5.         self.backgroundColor = [UIColor lightGrayColor]; 
  6.         _colorArray = [NSArray array]; 
  7.         NSArray *array = @[[UIColor darkGrayColor], 
  8.                            [UIColor redColor], 
  9.                            [UIColor greenColor], 
  10.                            [UIColor blueColor], 
  11.                            [UIColor yellowColor], 
  12.                            [UIColor orangeColor], 
  13.                            [UIColor purpleColor], 
  14.                            [UIColor brownColor], 
  15.                            [UIColor blackColor]]; 
  16.   
  17.         _colorArray = array; 
  18.         [self creatColorButtons:array]; 
  19.     } 
  20.     return self; 
  21.   
  22. - (void)creatColorButtons:(NSArray *)array 
  23.     NSInteger count = array.count; 
  24.     CGFloat buttonW = (self.bounds.size.width - (array.count+1)*kButtonSpace)/count; 
  25.     CGFloat buttonH = self.bounds.size.height; 
  26.     for (NSInteger i = 0; i<array.count; i++)="" {="" uicolor="" *color="array[i];" uibutton="" *button="[UIButton" buttonwithtype:uibuttontypecustom];="" button.tag="i;" [button="" addtarget:self="" action:@selector(tagbutton:)="" forcontrolevents:uicontroleventtouchupinside];="" cgfloat="" buttonx="kButtonSpace" +="" i="" *="" (buttonw="" +kbuttonspace);="" button.frame="CGRectMake(buttonX," 5,="" buttonw,="" buttonh-10);="" setbackgroundcolor:color];="" [self="" addsubview:button];="" }="" -="" (void)tagbutton:(uibutton="" *)button="" [uiview="" animatewithduration:0.5f="" animations:^{="" self.frame="CGRectMake(0," -self.bounds.size.height,="" 320,="" 44);="" }];="" _toolcolorblock(_colorarray[button.tag]);="" }<="" pre=""
  27.                       
  28.                 </array.count;>

源碼下載地址:http://down.51cto.com/data/1975550

責任編輯:閆佳明 來源: 網絡整理
相關推薦

2013-06-27 11:10:01

iOS開發自定義UISlider

2012-07-24 15:03:19

OpenStack架構

2023-07-21 19:16:59

OpenAIChatGPT

2013-07-18 16:09:10

自定義iOS狀態欄iOS開發iOS學習

2015-02-11 17:49:35

Android源碼自定義控件

2009-09-17 09:51:18

Eclipse JDT自定義跳轉

2010-04-30 09:32:49

ASP.NET MVC

2011-08-02 11:17:13

iOS開發 View

2021-01-20 08:58:39

iOS 14桌面圖標快捷指令

2013-05-30 15:53:17

iOS開發iOS SDKPopver

2009-09-07 22:00:15

LINQ自定義

2022-05-18 07:44:13

自定義菜單前端

2012-06-01 11:02:33

2017-10-25 14:07:54

APPiOSxcode

2015-01-22 15:59:07

Android源碼日期時間控件SelectTime

2009-04-23 09:05:08

IE8llq自定義功能

2016-02-26 14:57:50

飛象網

2012-12-24 14:42:48

iOS自定義狀態欄

2015-02-12 15:33:43

微信SDK

2009-06-17 16:00:03

Hibernate自定
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 一级看片免费视频 | 亚州激情 | 日本三级电影在线免费观看 | 日韩一级免费电影 | www.欧美视频| 天堂在线1 | 男人天堂手机在线视频 | 亚洲免费一区二区 | 毛片站| 成人一区在线观看 | 免费视频二区 | av日韩高清 | 在线精品一区二区三区 | 国产精品一区二区在线 | 国产精品永久免费观看 | www午夜视频 | 91.com视频| 国产亚洲精品久久久久久牛牛 | 五月香婷婷 | 国产精品视频在线播放 | 国产精品久久国产精品99 gif | 国产乱码久久久 | 成人欧美一区二区三区在线播放 | 中文字幕免费视频 | 中文字幕在线精品 | 91精品综合久久久久久五月天 | 国产成人免费网站 | 色吧色综合 | 欧美中文字幕一区二区三区亚洲 | 亚洲另类自拍 | 免费一级片 | 久久黄网| 国产精品99久久久久久www | 免费网站国产 | 最新国产在线 | 亚洲高清免费观看 | 色婷综合网 | 国产中文视频 | av三级在线观看 | 欧美黑人激情 | 精品国产91久久久久久 |