如何将ContentView添加到Click事件?

时间:2019-04-14 13:02:46

标签: xamarin xamarin.forms xamarin.android xamarin.uwp

我的任务是创建一个程序,该程序在主屏幕上显示两个按钮以及我的姓名和当前时间/日期。目的是一旦按下其中一个按钮即可使用整个屏幕,从而显示一个段落。到目前为止,我已经创建了带有标签和按钮的主页。但是,我对于如何显示有关所单击按钮的段落非常迷失。我正在使用经验合适的文本方式来充分利用屏幕。我已经创建了FontCalc.Cs页面,并在主页中添加了所有代码的onContentViewSizeChanged方法。我不知道下一步如何进行。到目前为止,这是我的点击处理程序事件中的内容:

        passage1Button.Clicked += (sender, args) =>
        {
            passage.Text = "So they began working together, each squadron leader commanding indivual pilots, " +
                           "Ender comanding the squadron leaders. They learned manyw ays of working together, " +
                           "as the simulator forced them to try different situations. Sometimes the simulator " +
                           "gave them a larger fleet to work with; Ender set them up then in three or four " +
                           "toons that consisted of three or four squadrons each. Sometimes the simulator gave " +
                           "them a single starship with its twelve fighters, and he chose three sqaudron leaders. ";

            ContentView contentView = new ContentView
            {
                Content = passage
            };
            contentView.SizeChanged += onContentViewSizeChanged;

它不会冻结按钮而显示段落,只会冻结android模拟器和UWP本地计算机。

1 个答案:

答案 0 :(得分:0)

您可以在单击按钮时显示模态

import boto3
s3 = boto3.resource('s3')
s3.meta.client.download_file('mybucket', 'bot/src/lstm.py', './lstm.py')

在ShowTextPage上,将HasNavigationBar设置为false