does know why appearing white part? view gray, gets 2 white pieces
whites: arrow , final popover!
[update]
this code calls popover , makes arrow points button clicked!
- (void) buttonfilter { if (viewfilter == @"artistas") { content = [self.storyboard instantiateviewcontrollerwithidentifier:@"tipoartistaviewcontroller"]; // mudar para o novo filtro de artistas } else if (viewfilter == @"músicas") { content = [self.storyboard instantiateviewcontrollerwithidentifier:@"categoriaviewcontroller"]; } [self callfilter:btnfilter filter:content]; } - (void)callfilter:(id)sender filter:(uiviewcontroller *) content{ self.currentpop = popovercontroller; popovercontroller = [[wypopovercontroller alloc] initwithcontentviewcontroller:content]; uibutton * bt = (uibutton * )sender; uiview *view = [bt valueforkey:@"view"]; popovercontroller.popovercontentsize = cgsizemake(320, 180); popovercontroller.delegate = self; [popovercontroller presentpopoverfromrect:view.bounds inview:view permittedarrowdirections:wypopoverarrowdirectionany animated:yes]; }
the next mount session:
//extend , collpase - (void)setupviewcontroller { categoriabd = [categoriadao selectcategoria]; self.data = [[nsmutablearray alloc] init]; (int = 0; < [categoriabd count]; i++) { nsmutabledictionary * teste = [categoriabd objectforkey:[nsstring stringwithformat:@"%i", i]]; id = [[teste objectforkey:@"1"] integervalue]; subcategoriabd = [categoriadao selectsubcategoriabycategoriaid:id]; nsmutablearray* section = [[nsmutablearray alloc] init]; (int j = 0; j < [subcategoriabd count]; j++) { nsmutabledictionary * subcat = [subcategoriabd objectforkey:[nsstring stringwithformat:@"%i", j]]; [section addobject:[nsstring stringwithformat:[subcat objectforkey:@"1"]]]; } [self.data addobject:section]; } self.headers = [[nsmutablearray alloc] init]; (int = 0; < [categoriabd count]; i++) { nsstring *instr = [nsstring stringwithformat: @"%i", (int)i]; nomecategoria = [categoriabd objectforkey:instr]; uilabel *label = [[uilabel alloc] initwithframe:cgrectmake(5, 5, 310, 40)]; [label settext:[nomecategoria objectforkey:@"2"]]; uiview* header = [[uiview alloc] init]; [header setbackgroundcolor:[uicolor colorwithred:(226/255.0) green:(226/255.0) blue:(226/255.0) alpha:1]]; [header addsubview:label]; [self.headers addobject:header]; } }
you can create custom uipopoverbackgroundview
subclass sets properties of arrow want.
popovercontroller.popoverbackgroundviewclass = [mypopoverbackgroundview class];
Comments
Post a Comment