android - AutoResizeTextView does not resize after other Views are hidden (View.GONE) -
context :
I have two linear lines inside I About one-third of the size of one and the other, I want to be as big as possible. That's why I can be used in layout_weight = 1 and layout_weight = 3 in the XML code below
Problem :.
When I use other TextViews hide scene fragment (stored as mView), at:
textView7.setVisibility (see. GONE); (.. too much .. ..) More space becomes available for linear layout, and therefore I hope AutoResizeTextViews will grow. Although two AutoResizeTextViews do not grow, and their canvas size keeps on growing. They are taken to align the new 1/3 ratio of LinearLayout, so there really is not space inside the LinearLayout.
the activity and restart the device reorientation to see (I do not maintain piece) they change as expected, apparently canvas is prepared again exactly how I AutoResizeTextView correctly to turn the can tool without being redrawn
tried before only :
mView.forceLayout (); MView.refreshDrawableState (); MView.requestLayout (); MView.invalidate (); LinearLayoutAutoFit.invalidate (); TvTimer.invalidate (); TvTimer.setTextsize (999); Not all work, the text has not been adjusted in the new size.
XML code :
& lt; LinearLayout android: id = "" @ + id / linearLayoutAutoFit android: orientation = "vertical" android: Layout_width = "Match_parent" Android: Layout_height = "Match_parent" Android: layout_above = "@ + id / viewline2" Android: Leaut_belo = "@ ID / Progress Bar 3 "Android: Layout_ALINGPrinilft =" True "& gt; & Lt; AutoResizeTextView Android "Android: attr / textAppearanceLarge" layout_weight = "3" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" Android textAppearance = android: text = "@ string / ready" android: id = "@ + Id / TextViewAction "Android: textSize =" 999sp "Android: textColor =" # ADFF2F "Android: singleLine =" true "/> & Lt; AutoResizeTextView Android: "Android: attr / textAppearanceLarge" layout_weight = "1" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android textAppearance = Android: id = "@ + id / tvTimer" Android: textcolor = "#fff "android: text =" @ string / Int_taim "android: text size =" 999sp "Android: visibility =" visible "Android: singleLine =" true "/ & gt; & Lt; / LinearLayout & gt;
Instead:
android: layout_height = "Wrap_content" type:
android: layout_height = "0dp"
Comments
Post a Comment