小秋的家

          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ò)活動(dòng)風(fēng)火輪是否旋轉(zhuǎn)
          [UIApplication sharedApplication].networkActivityIndicatorVisible,默認(rèn)值是NO。
          鍵盤透明
          textField.keyboardAppearance = UIKeyboardAppearanceAlert;
          截取屏幕圖片
          //創(chuàng)建一個(gè)基于位圖的圖形上下文并指定大小為CGSizeMake(200,400)
          UIGraphicsBeginImageContext(CGSizeMake(200,400));
          //renderInContext 呈現(xiàn)接受者及其子范圍到指定的上下文
          [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
           //返回一個(gè)基于當(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í)行.
          動(dòng)畫:一個(gè)接一個(gè)地顯示一系列的圖象
          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屬性返回一個(gè)存放動(dòng)畫圖片的數(shù)組
          myAnimatedView.animationDuration = 0.25; //瀏覽整個(gè)圖片一次所用的時(shí)間
          myAnimatedView.animationRepeatCount = 0; // 0 = loops forever 動(dòng)畫重復(fù)次數(shù)
          [myAnimatedView startAnimating];
          [self addSubview:myAnimatedView];
          [myAnimatedView release];
          posted on 2011-10-25 15:35 棋劍小秋 閱讀(254) 評(píng)論(0)  編輯  收藏 所屬分類: iPhone
          主站蜘蛛池模板: 西华县| 东兴市| 鹤岗市| 班玛县| 水富县| 施甸县| 陆河县| 当雄县| 弋阳县| 石渠县| 崇礼县| 永定县| 砀山县| 桐城市| 将乐县| 无极县| 赞皇县| 克拉玛依市| 黑龙江省| 绥化市| 车致| 工布江达县| 错那县| 青川县| 博兴县| 安化县| 宁城县| 稻城县| 昌图县| 大竹县| 榆社县| 清远市| 商南县| 赤峰市| 海盐县| 阳山县| 昭觉县| 台江县| 六枝特区| 垣曲县| 涞水县|