小编Gay*_*ale的帖子

xamarin.forms如何刷新内容视图和内容页面?

ContentViewCarouselPage.我ConentPage从导航到ContentView.更新ContentPage并返回ContentView.

现在,在这个笔记上,我ContentView没有得到更新.

此外,如果我在输入中更改文本ContentView并转到ContentPage并返回,则我的条目更改将被删除.

那么,是否有任何机制,以便当我回到ContentView它时刷新?

我尝试使用OnAppearing()方法,ContentView但它显示错误ContentView does not contain definition for OnAppearing().

谢谢.:)

xamarin.forms

7
推荐指数
1
解决办法
3853
查看次数

如果 Grid.Row 已知,如何获取网格行的子级

我正在开发 xamarin.forms 应用程序,但我有无法解决的问题。

1)我有多个Grid相继包含按钮、标签和图像的s。现在,单击按钮我想更改图像或将其旋转到向下。但不知何故,我无法做到这一点。

我的第一次尝试是获取按钮的父级并使用FindByName方法查找图像。但FindByName返回 null,但我可以在调试时看到父级中的网格。

我的第二次尝试是获取按钮行并找到该行中的所有控件。因为我的图像与按钮位于同一行。

我的结构是这样的

当我单击箭头(即图像)时,它应该改变

我的网格工作正常,但只有旋转问题存在。

pubic void OnButtonClicked(object sender, EventArgs e)
{
   var SenderButton = (Button)sender;
   var row = Grid.GetRow(SenderButton); // Here i get row = 0 but dont know how to find other controls on same row.

   Image upimage = SenderButton.Parent.FindByName<Image>("imageExpand");  // imageExpand is my image name in grid.
   upimage.Source = "upimage.png";
}
Run Code Online (Sandbox Code Playgroud)

upimagenull

非常感谢。

xamarin.forms

5
推荐指数
1
解决办法
8985
查看次数

Xamarin.Forms 将视频设置为启动画面

我正在研究xamarin.forms共享项目。我在将视频设置为启动画面时遇到问题。我从这里得到了参考。

我面临的问题是视频播放器已初始化并执行其过程,此时 AppDelegate 代码首先返回。所以视频没有显示,但它的声音来了。有什么我想念的吗?

在这里,我合并VideoControllerVideoViewController样品。我只VideoViewControllerSetMoviePlayer()功能中使用和引用来自资源文件夹的视频

我试过的代码:

AppDelegate.cs

[Register("AppDelegate")]
public partial class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
    public override UIWindow Window { get; set; }
    VideoViewController control = new VideoViewController();

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            try
            {
                Window = new UIWindow(UIScreen.MainScreen.Bounds);

                Window.RootViewController = control;

                //global::Xamarin.Forms.Forms.Init();
                //LoadApplication(new App());

                //control.VideoCompletionEvent += Control_VideoCompletionEvent;   // Tried to invoke this on video completion but doesn't help. AppDelegate returns value first then this …
Run Code Online (Sandbox Code Playgroud)

splash-screen xamarin.ios avplayer xamarin.forms

4
推荐指数
1
解决办法
816
查看次数