1

I was using segmented controls inside alert views for quick user insert data, but in ios 7 the segmented control doesn't appears! Is it forbidden ? My code ..

UISegmentedControl *segControl = [[UISegmentedControl alloc] initWithItems:[NSArray    arrayWithObjects:@"2", @"3", @"4", @"5",@"6", @"7",@"8", @"9",nil]];
segControl.selectedSegmentIndex = 2;

[myAlertView addSubview:segConTimes];

I tried ...

 [segConTimes setTintColor:[UIColor blackColor]];

But it still doesn't appear. Anyone knows how to do it ?

Fischer
  • 1,513
  • 4
  • 17
  • 38

2 Answers2

1

I had this problem, I wanted to add a UIPickerView and I ended up adding this open source code to my project. It replicates the Apple one but you can specifically everything you want into the content view. Very easy to use too and fully customisable!

https://github.com/wimagguc/ios-custom-alertview

BalestraPatrick
  • 9,944
  • 4
  • 30
  • 43
1

Would you like to try on my component? The middle area is able to add any views.

CXAlertView - Custom alert-view which allow you to add view as main content.

enter image description here

Chris
  • 428
  • 2
  • 10