i following requirement.
i need build tree leaves placed left , right, screen top bottom. can not put leaves in listview because tow leaves in same offset.
i don't know height of items.
i need pre-calculate height of dynamic content, such strings different lengths.
question:
how can pre-calculate height of sting put in textview widget described follows:
<textview android:id="@+id/note_content" android:layout_width="40sp" android:layout_height="wrap_content" android:maxlines="5" /> 
create textview, set layoutparams, set text, call it's measure method , read measured values. btw can measure text, not textview (see staticlayout).
i think better create custom layout can implement "leaves measument" algorithms. check lesson. custom layout easy )
Comments
Post a Comment