ios - MKAnnotation Left / Right Accessory View Misplacement -
cannot figure out why occurs. when title , subtitle text long, expected ... @ end of text. left , right accessory views messed this.
the accessory view frame , bounds have not changed. same when views drawn normally. like,
either title can long or subtile can long, , views not misplaced. when both long , have trailing ... messed up.
cannot find documentation max size of view / or text length etc should be.
i've resorted hack of counting string length , when exceed limit print out short title or subtitle. i'd rather leave , figure out why views pushed , how fix.
thanks
note: im use default mkannotationview, setting title , subtitle.
this seems bug can workarounded in different ways.
the rightcalloutaccessoryview
vertical alignment can fixed setting autoresizingmask
follows:
uibutton *rightbutton = [uibutton buttonwithtype:uibuttontypeinfolight]; rightbutton.autoresizingmask = uiviewautoresizingflexiblebottommargin | uiviewautoresizingflexibletopmargin; annotationview.rightcalloutaccessoryview = rightbutton;
the same trick not work leftcalloutaccessoryview
apparently has bug how nslayoutattributes setup default. in case easiest (ugliest) , fix found hard code height of view assign leftcalloutaccessoryview
: 54px on ios8, 45px on ios7.
Comments
Post a Comment