首先,我在Xamarin for Android应用程序中编写代码。在布局中获取TextView的高度
我试过的是这个。
frame.AddView(background, LayoutParams.MatchParent, textViewA.Height);
frame.AddView(textViewA, LayoutParams.MatchParent, LayoutParams.WrapContent);
1)背景是具有背景的视图。的FrameLayout的帧(例如)被设置
2)后,我添加此布局为tablerow
的问题是它。由于textViewA.Height的值为0,所以我看不到背景。
如果我改变textViewA.Height到LayoutParams.WrapContent或LayoutParams.MatchParent,那么背景覆盖孔页。
,如果我改变textViewA.Height 15,背景涵盖TextView中的一部分。
所以,(我认为)我必须知道textViewA的高度值的大小,使显示的背景。 如何做到这一点?帮我。
谢谢,非常感谢! – wallah