简体   繁体   English

蒂森。 如何更新页面内容 CircleScrollView 的孩子

[英]Tizen. How to update the Children of a Page Content CircleScrollView

Creating a wearable Tizen .net application, I create an application that contains a CirclePage variable:创建可穿戴 Tizen .net 应用程序,我创建了一个包含 CirclePage 变量的应用程序:

private CirclePage _mainPage;

I then populate its Content property with some Content:然后我用一些内容填充它的 Content 属性:

        _mainPage = new CirclePage
        {
            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions = LayoutOptions.Center,
                Orientation = StackOrientation.Vertical,
                Children = {
                    new Label { HorizontalTextAlignment = TextAlignment.Center, Text = "Text!" },
                    button
                }
            }
        };
        _mainPage.CircleSurfaceItems.Add(circleSlider);
        _mainPage.RotaryFocusObject = circleSlider;

        MainPage = _mainPage;

At a later point I want to update that page giving it a CircleScrollView:稍后我想更新该页面并为其提供 CircleScrollView:

var circleScrollView = new CircleScrollView
            {
                Content = new StackLayout
                {
                    Orientation = StackOrientation.Vertical,
                    Children =
                    {
                        new Label { Text = "scroll!" },
                        new Label { Text = "scroll!" }
                    }
                }
            };
            _mainPage.Content = circleScrollView;

Everything is fine to this point.一切都很好。 But say i want to update that List, I notice that after creation/initialization, there doesn't seem to be any methods to update the Children of the Content as Children are read only after created.但是说我想更新该列表,我注意到在创建/初始化之后,似乎没有任何方法可以更新内容的子项,因为子项在创建后才被读取。

Do i need to create a new CircleScrollView and populate the Children each time my list changes?每次我的列表更改时,我是否需要创建一个新的 CircleScrollView 并填充 Children? I suppose i do not have any concrete reason to believe this is inefficient, but other platforms such as apple and android devices seem to provide methods to insert/remove/ or otherwise update a view listing.我想我没有任何具体的理由相信这是低效的,但其他平台(如苹果和安卓设备)似乎提供了插入/删除/或以其他方式更新视图列表的方法。

Im brand noob with tizen so i apologize in advance if this seems a vapid question我是 tizen 的菜鸟,所以如果这似乎是一个无聊的问题,我提前道歉

Try the following:请尝试以下操作:

(circleScrollView.Content as StackLayout).Children.Add(...)
(circleScrollView.Content as StackLayout).Children.Remove(...)

Check the documentation for more.查看文档了解更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM