If I declare LinearLayout linearLayout
and look at linearLayout.getLayoutParams()
, it gives me ViewGroup.LayoutParams
, not LinearLayout.LayoutParams
.
So I have to use the repeating (and thus bad) style construction of:
int lm = ((LinearLayout.LayoutParams) linearLayout.getLayoutParams()).leftMargin?
Do I really have to use it, if I want to reach margins, for example?
Is it my misunderstanding of Android or Java, or both or something else?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…