2012-06-29 68 views
0

這裏是我的水平UIPickerView(通過旋轉&規模ORI UIpicker):HTP://s7.postimage.org/qzez9d0pn/Original.png如何裁剪我的UIPickerView?

而現在,我想要做的是切斷這兩個空間:http://s7.postimage.org/bryzp08uz/Process.png

爲了促成更好的外觀效果:http://s7.postimage.org/6ulf3w6vv/Result.png

有人請幫我該怎麼辦呢......?

我旋轉&規模代碼:

thePickerView.delegate = self; 
thePickerView.showsSelectionIndicator =YES; 
thePickerView.center = CGPointMake(xVar, yVar); // position 
CGAffineTransform rotate = CGAffineTransformMakeRotation(-3.14/2); // rotate 
rotate = CGAffineTransformScale(rotate, 0.1, 1); // scale 
[thePickerView setTransform:rotate]; 

UILabel *theview[num]; 
CGAffineTransform rotateItem = CGAffineTransformMakeRotation(3.14/2); 

for (int i=0;i<num;i++) { 
    theview[i] = [[UILabel alloc] init]; 
    theview[i].text = [NSString stringWithFormat:@"%d",i+1]; 
    theview[i].textColor = [UIColor blackColor]; 
    theview[i].frame = CGRectMake(0,0, 100, 100); 
    theview[i].backgroundColor = [UIColor clearColor]; 
    theview[i].textAlignment = UITextAlignmentCenter; 
    theview[i].shadowColor = [UIColor whiteColor]; 
    theview[i].shadowOffset = CGSizeMake(-1,-1); 
    theview[i].adjustsFontSizeToFitWidth = YES; 

    theview[i].transform = CGAffineTransformScale(rotateItem, 1, 10); 
} 
itemArray = [[NSMutableArray alloc] init]; 
for (int j=0;j<num;j++) {[itemArray addObject:theview[j]];} 
[thePickerView selectRow:row inComponent:0 animated:NO]; 
[self.view addSubview:thePickerView]; 

回答

0

我的臨時解決方案,同時尋找&等待更好的編碼的答案是創建一個疊加背景圖片,然後透明PickerView的慾望空間= =