Horizontal Picker View

– (void)viewDidLoad {
[super viewDidLoad];
pickerViewArray = [[NSArray arrayWithObjects:
@”Amir Mohammad”, @”Azam Mohammad”,@”Muzammil Azmi”,
@”Tauseef Ahmad”, @”Afzal Siddiqui”, @”Umar Niazi”, @”Sharib Jalalpuri”,
nil] retain];
myPickerView = [[UIPickerView alloc] initWithFrame:CGRectZero];
myPickerView.delegate = self;
myPickerView.showsSelectionIndicator =YES;
myPickerView.backgroundColor = [UIColor clearColor];
CGAffineTransform rotate = CGAffineTransformMakeRotation(3.14159265*3.5);
rotate = CGAffineTransformScale(rotate, .25, 2.0);
[myPickerView setTransform:rotate];
[self.view addSubview:myPickerView];}

– (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
CGRect rect = CGRectMake(0, 0, 120, 80);
UILabel *label = [[UILabel alloc]initWithFrame:rect];
CGAffineTransform rotate = CGAffineTransformMakeRotation(3.14/2);
rotate = CGAffineTransformScale(rotate, 0.25, 2.0);

[label setTransform:rotate];
label.text = [pickerViewArray objectAtIndex:row];
label.font = [UIFont systemFontOfSize:22.0];
label.textAlignment = UITextAlignmentCenter;
label.numberOfLines = 2;
label.lineBreakMode = UILineBreakModeWordWrap;
label.backgroundColor = [UIColor clearColor];
label.clipsToBounds = YES;
return label ;

}

This entry was posted in iOS by Muzammil. Bookmark the permalink.

About Muzammil

Hey Guys, I am Muzammil Mohammad. Having 7 years of experience in iOS development. I am here to share my knowledge with all mobile application developers and those companies who are stuck on development (due to bad quality of code or don't know what to do) or want to know how to build a good mobile app. I believe I am more expert in UI and Architecture design of mobile app. So if you need my helps or assistant for your mobile app projects, Feel free to contact me. I will try my best to improve the quality of your app. Or you can hire me to develop your apps. I’d love to talk with you. Best!

Leave a Reply

Your email address will not be published. Required fields are marked *