我ContentView
在CarouselPage
.我ConentPage
从导航到ContentView
.更新ContentPage
并返回ContentView
.
现在,在这个笔记上,我ContentView
没有得到更新.
此外,如果我在输入中更改文本ContentView
并转到ContentPage
并返回,则我的条目更改将被删除.
那么,是否有任何机制,以便当我回到ContentView
它时刷新?
我尝试使用OnAppearing()
方法,ContentView
但它显示错误ContentView does not contain definition for OnAppearing()
.
谢谢.:)
我正在开发 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)
这upimage
是null
。
非常感谢。
我正在研究xamarin.forms
共享项目。我在将视频设置为启动画面时遇到问题。我从这里得到了参考。
我面临的问题是视频播放器已初始化并执行其过程,此时 AppDelegate 代码首先返回。所以视频没有显示,但它的声音来了。有什么我想念的吗?
在这里,我合并VideoController
和VideoViewController
样品。我只VideoViewController
在SetMoviePlayer()
功能中使用和引用来自资源文件夹的视频
我试过的代码:
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)