android - Why does calling setLayoutParams on subview trigger layout on parent view -
i have custom view textview inside it. when update layoutparams of textview, requestlayout trigger on parent view. know why? there way position textview inside parent without having re-layout entire parent view?
relativelayout.layoutparams params = (relativelayout.layoutparams)childtextview.getlayoutparams(); params.setmargins(0, 100, 0, 0); childtextview.setlayoutparams(params);
the setlayoutparams
call above triggers layout pass avoid.
--- ??
no!!
do know layoutparams
does ? does, , function seeing.
parents best care children based on have, derived children - layoutparams
tells parent how child suppose treated. if changes parent needs re-adjust care towards child.
so no there no way -(you have live that.)
Comments
Post a Comment