【问题标题】:Xamarin ScrollView not workingXamarin ScrollView 不工作
【发布时间】:2016-08-15 03:34:46
【问题描述】:

我正在阅读Xamarin Mobile App Development by Apress 并且遗漏了一些东西。我删除了这段代码,去掉了不必要的东西:

    public ContentPageExample()
    {
        var layout = new StackLayout
        {
            Children =
            {
                // bunch of "View"s here
            },
            HeightRequest = 1500
        };

        ScrollView scrollView = new ScrollView
        {
            VerticalOptions = LayoutOptions.FillAndExpand,
            Content = layout
        };

        this.Content = scrollView;
    }

但是,内容不会滚动。我在WinPhoneAndroid 模拟器中都试过了(没有Mac 方便尝试iPhone 一个)。书上说东西应该滚动。我错过了什么?

【问题讨论】:

  • 使用 Android 模拟器对我来说确实滚动得很好。
  • 我在 Android 手机、模拟器和 WinPhone 模拟器上尝试过,它对我来说运行正常

标签: c# xamarin xamarin.android xamarin.forms xamarin.winphone


【解决方案1】:

我会发表评论,但我还没有积分。

我有类似的问题:我的滚动视图在 mac/iPhone 模拟器上工作(不知道 winPhone),但在 Android 模拟器上不工作。

我注意到的是:在页面中创建滚动视图适用于模拟器,将页面放在导航页面中,它不再适用于模拟器......如果有人对此了解更多,请告诉。

我的解决方法是:不使用模拟器。将其构建到实际设备上。

我希望这对某人有所帮助,因为我花了很长时间才弄清楚。

【讨论】:

  • “我会评论,但我还没有积分” ...然后等到你有足够的代表,我建议使用拼写检查器。
  • 等待不累积代表。
  • 确实,我想你可以确认一下。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多