【问题标题】:how to set the height of a ListView in Mono for android?如何在 Mono for android 中设置 ListView 的高度?
【发布时间】:2013-02-27 16:19:31
【问题描述】:

像这里的一些或许多一样,我想知道如何以编程方式设置 ListView 的高度,但似乎没有人对单声道有这个问题。我已经看到了一些适用于普通 Android、Java 的解决方案,但到目前为止还没有看到适用于 C# 的解决方案。其中一些是>this<>this< 之一。在 android 的 Mono 中,没有什么像 ListView 的 getLayoutParams() 或听起来像的东西。那么如何以编程方式设置它的高度属性?

【问题讨论】:

    标签: android android-listview height xamarin.android


    【解决方案1】:

    试试这个

    ListView listAccounts = FindViewById<ListView>(Resource.Id.listAccounts);
    listAccounts.LayoutParameters.Height = 200;
    

    【讨论】:

      猜你喜欢
      • 2016-10-26
      • 2011-03-13
      • 1970-01-01
      • 1970-01-01
      • 2013-10-07
      • 2012-07-13
      • 2023-03-11
      • 2015-03-16
      • 2012-11-29
      相关资源
      最近更新 更多