ios - How to rotate UITableViewCellAccessoryDisclosureIndicator? -
i'm making uitableview expandable/collapsable cells ios app. put uitableviewcellaccessorydisclosureindicator on these cells i'd make arrow headed up/down when cell expanded/collapsed.
i found it's possible make button custom image , change button according state of cell seems dirty me because don't need button there , have add 2 images project (ok it's not big anyway).
so shouldn't better rotate existing uitableviewcellaccessorydisclosureindicator ? , if how can that?
this not want, first thing thought of. first, instantiate button of type uibuttontypedetaildisclosure:
uibutton *button = [uibutton buttonwithtype:uibuttontypedetaildisclosure]; next, rotate button 90 degrees:
cgaffinetransform rotationtransform = cgaffinetransformidentity; rotationtransform = cgaffinetransformrotate(rotationtransform, degreestoradians(90)); button.transform = rotationtransform; finally, use button accessoryview:
cell.accessoryview = button; hope helps.
Comments
Post a Comment