osx - Row text moves up when row is deselected in NSOutlineView source list -
in app have set nsoutlineview displays categories sort of menu. works fine there problem when deselect item, titles in each row move in image below:
her code using:
- (nsinteger)outlineview:(nsoutlineview *)outlineview numberofchildrenofitem:(id)item { return [sectionsarray count]; } - (bool)outlineview:(nsoutlineview *)outlineview isitemexpandable:(id)item { return no; } -(bool)outlineview:(nsoutlineview*)outlineview isgroupitem:(id)item { return no; } - (nsview *)outlineview:(nsoutlineview *)outlineview viewfortablecolumn:(nstablecolumn *)tablecolumn item:(id)item { nstablecellview *cellview = [outlineview makeviewwithidentifier:@"datacell" owner:self]; cellview.imageview.image = [nsimage imagenamed:@"point.png"]; cellview.textfield.stringvalue = item; sectioncellcountfield *number = [[sectioncellcountfield alloc] initwithframe:nsmakerect(cellview.frame.size.width-50, 4, 35, 16)]; [cellview addsubview:number]; int rows = 0; (int = 0; < [dataarray count]; i++) { if ([item isequaltostring:[[dataarray objectatindex:i]valueforkey:@"cathegory"]]) { rows = rows +1; } } number.stringvalue = [nsstring stringwithformat:@"%i", rows]; return cellview; } - (id)outlineview:(nsoutlineview *)outlineview child:(nsinteger)index ofitem:(id)item { return [sectionsarray objectatindex:index]; }
anybody have idea why behavior occurring? lot!
are using autolayout? i've seen sort of thing happen when forgot constrain @ least 2 of table cell view subview's top, bottom, or height. table , outline views tends make ambiguous layouts act up.
Comments
Post a Comment