小秋的家

          home

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            1 Posts :: 91 Stories :: 17 Comments :: 0 Trackbacks
          去除nsstring中的空格
          NSCharacterSet *whitespace = [NSCharacterSet whitespaceAndNewlineCharacterSet];
          NSString *username = [mUsernameField stringValue];
          username = [username stringByTrimmingCharactersInSet:whitespace];
          讓覆蓋在下面層的視圖接受觸摸事件
          searchImage.exclusiveTouch = YES;//第一層
          searchImage.userInteractionEnabled = NO;
          myMapView.exclusiveTouch = NO;//第二層
          myMapView.userInteractionEnabled = YES;

          防止屏幕暗掉鎖屏
          [[UIApplication sharedApplication] setIdleTimerDisabled:YES];
          狀態(tài)欄的網(wǎng)絡(luò)活動風(fēng)火輪是否旋轉(zhuǎn)
          [UIApplication sharedApplication].networkActivityIndicatorVisible,默認(rèn)值是NO。
          鍵盤透明
          textField.keyboardAppearance = UIKeyboardAppearanceAlert;
          截取屏幕圖片
          //創(chuàng)建一個基于位圖的圖形上下文并指定大小為CGSizeMake(200,400)
          UIGraphicsBeginImageContext(CGSizeMake(200,400));
          //renderInContext 呈現(xiàn)接受者及其子范圍到指定的上下文
          [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
           //返回一個基于當(dāng)前圖形上下文的圖片
           UIImage *aImage = UIGraphicsGetImageFromCurrentImageContext();
           //移除棧頂?shù)幕诋?dāng)前位圖的圖形上下文
          UIGraphicsEndImageContext();
          //以png格式返回指定圖片的數(shù)據(jù)
          imageData = UIImagePNGRepresentation(aImage);
          更改cell選中的背景
          UIView *myview = [[UIView alloc] init];
          myview.frame = CGRectMake(0, 0, 320, 47);
          myview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"0006.png"]];
          cell.selectedBackgroundView = myview;
          從本地加載圖片
          NSString *boundle = [[NSBundle mainBundle] resourcePath];
          [web1 loadHTMLString:[NSString stringWithFormat:@"<img src='http://fei263.blog.163.com/blog/0001.png'/>"] baseURL:[NSURL fileURLWithPath:boundle]];
          View自己調(diào)用自己的方法:
          [self performSelector:@selector(loginToNext) withObject:nil afterDelay:2];//黃色段為方法名,和延遲幾秒執(zhí)行.
          動畫:一個接一個地顯示一系列的圖象
          NSArray *myImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"myImage1.png"], [UIImage imageNamed:@"myImage2.png"], [UIImage imageNamed:@"myImage3.png"], [UIImage imageNamed:@"myImage4.gif"], nil];
          UIImageView *myAnimatedView = [UIImageView alloc];
          [myAnimatedView initWithFrame:[self bounds]];
          myAnimatedView.animationImages = myImages; //animationImages屬性返回一個存放動畫圖片的數(shù)組
          myAnimatedView.animationDuration = 0.25; //瀏覽整個圖片一次所用的時間
          myAnimatedView.animationRepeatCount = 0; // 0 = loops forever 動畫重復(fù)次數(shù)
          [myAnimatedView startAnimating];
          [self addSubview:myAnimatedView];
          [myAnimatedView release];
          posted on 2011-10-25 15:35 棋劍小秋 閱讀(254) 評論(0)  編輯  收藏 所屬分類: iPhone
          主站蜘蛛池模板: 武冈市| 巩义市| 孝感市| 宁国市| 霍州市| 镇宁| 彝良县| 景德镇市| 邹城市| 大同市| 阿巴嘎旗| 澎湖县| 卓尼县| 武平县| 邹平县| 鄯善县| 界首市| 大悟县| 天门市| 合川市| 曲靖市| 定安县| 雷山县| 黔江区| 揭西县| 安陆市| 达拉特旗| 五大连池市| 遂溪县| 睢宁县| 运城市| 康马县| 项城市| 台北县| 禹州市| 融水| 杭州市| 老河口市| 香港 | 扎兰屯市| 兴业县|