I have UIPickerView with two columns and in one column I want to display image and label next to it. It works. Display and image and label, just label is under image how to put image on the left, and label on the right side? I tried to changle label align to right but it doesnt work.
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row
forComponent:(NSInteger)component reusingView:(UIView *)view
{
if(component == kStateComponent)
{
UIImage *img = [UIImage imageNamed:@"rts1.png"];
UIImageView *temp = [[UIImageView alloc] initWithImage:img];
temp.frame = CGRectMake(0, 0, 29, 29);
UILabel *channelLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 60, 60)];
channelLabel.text = @"sdfsdfdsf";
channelLabel.textAlignment = UITextAlignmentLeft;
channelLabel.backgroundColor = [UIColor clearColor];
UIView *tmpView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 110, 60)];
[tmpView insertSubview:temp atIndex:0];
[tmpView insertSubview:channelLabel atIndex:1];
return tmpView;
}
...
}