Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
像这里的一些或许多一样,我想知道如何以编程方式设置 ListView 的高度,但似乎没有人对单声道有这个问题。我已经看到了一些适用于普通 Android、Java 的解决方案,但到目前为止还没有看到适用于 C# 的解决方案。其中一些是>this<或>this<之一。在 Android 的 Mono 中,没有什么像 ListView 的 getLayoutParams() 或听起来像的东西。那么如何以编程方式设置它的高度属性?
尝试这个
ListView listAccounts = FindViewById<ListView>(Resource.Id.listAccounts); listAccounts.LayoutParameters.Height = 200;