- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用Monotouch.Dialog(Xamarin.iOS版本:6.2.0.65)创建带有RadioElements的RadioGroup。我只想要第二个屏幕(用户从长列表中选择)的“搜索”功能,所以我创建了一个单独的DialogViewController,在其中启用了搜索过滤器(enableSearch = true)。
在搜索框中键入内容时,应用程序会在RadioElement的GetCell方法中崩溃。
Element.cs的第1064行上的“对象引用未设置为对象的实例”。我有GC问题吗?我设法在一个小型应用程序中对其进行了仿真。。。不要关注一些奇怪的领域成员,那就是我测试是否要开始使用GC ...
using MonoTouch.Dialog;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace SearchCrash
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
public UINavigationController NavigationController { get; set; }
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow(UIScreen.MainScreen.Bounds);
this.NavigationController = new UINavigationController();
this.NavigationController.PushViewController(new FirstViewController(this.NavigationController), true);
window.RootViewController = this.NavigationController;
window.MakeKeyAndVisible();
return true;
}
}
public class FirstViewController : DialogViewController
{
private UINavigationController controller;
private LocatiesRootElement locRootElement;
private RadioGroup radioGroup;
public FirstViewController(UINavigationController c) : base(new RootElement("Test"), true)
{
this.controller = c;
}
public override void ViewDidLoad()
{
Section section = new Section();
radioGroup = new RadioGroup(0);
locRootElement = new LocatiesRootElement("test", radioGroup, this.controller);
section.Add(locRootElement);
Root.Add(section);
}
}
public class LocatiesRootElement : RootElement
{
private UINavigationController navigationController;
private LocatiesViewController locatiesViewController;
public LocatiesRootElement(string selectedLocatie, RadioGroup group, UINavigationController controller) : base("Locatie", group)
{
this.navigationController = controller;
this.locatiesViewController = new LocatiesViewController(this);
}
public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
{
this.navigationController.PushViewController(this.locatiesViewController, true);
}
}
public class LocatiesViewController : DialogViewController
{
public LocatiesViewController(LocatiesRootElement root) : base(root, true)
{
this.EnableSearch = true;
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
Section sectionList = new Section();
RadioElement radioElement1 = new RadioElement("item 1");
RadioElement radioElement2 = new RadioElement("item 2");
sectionList.Add(radioElement1);
sectionList.Add(radioElement2);
Root.Add(sectionList);
}
}
}
最佳答案
实例化DialogViewController
后,尝试启用搜索。
像这样 :
public LocatiesRootElement(string selectedLocatie, RadioGroup group, UINavigationController controller) : base("Locatie", group)
{
this.navigationController = controller;
this.locatiesViewController = new LocatiesViewController(this);
this.locatiesViewController.EnableSearch = true;
}
关于search - Monotouch.Dialog:EnableSearch和自定义RootElement崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15294509/
使用的浏览器 - Chrome 67.0.3396.99 我创建了一个 DialogsModule它有一个组件 ConfirmDialog.component.ts使用以下模板 confirm-dia
我一直在尝试制作一个简单的程序来使用Electron创建和读取文件。 到目前为止,我已经尝试了很多,并且似乎没有提供与dialog.showOpenDialog一起提供的回调函数。 dialo
我有一个登录对话框,想防止它在按下回车键时自动关闭。 更具体地说,当用户输入凭据并按下回车键时,凭据的响应返回错误,我希望对话框保留(这样我就可以向他们显示一些错误消息,让用户再试一次) . 这就是我
Jquery对话框的含义是什么:它是单独的网页还是网页的一部分? (我不太了解 Jquery)。 谢谢 最佳答案 jQuery 对话框将出现在页面上方,但它实际上是当前页面的一部分。当您加载对话框时,
当用户退出 xe:dialog 时,我需要做一些清理工作。我将代码放在 onUnload 事件中,如下所示: viewScope.remove("vsSomeVariable"); viewScope
我想相对于我的 html 元素之一定位 Dojo 的 Dijit 对话框。是否可以? 如是。如何? 目前它总是在视口(viewport)中间显示对话框。 有人可以帮我解决这个问题吗? 谢谢。 amar
即使属性设置为“openDirectory”,是否也可以在 showOpenDialog 中显示文件?当然,文件不应该是可选的,但可能会显示为灰色。所以用户知道他选择了正确的目录。在 OSX 上一切正
如何使用 android 标准组件 Bottom Sheet 单实现以下设计功能: 出现 Bottom Sheet 对话框片段时的图像: 用户向上滚动以查看内容底部时的图像: 我将使用 ViewPag
我刚开始使用对话框,我非常喜欢在资源文件中定义布局的可能性。但是是否可以设置一个对话框并将其嵌入到另一个对话框中(即没有 float 对话框)? 对于普通窗口,我创建了一个带有一个子窗口的主窗口。然后
我正在尝试更改 dialog 的背景颜色元素的 backdrop使用自定义 CSS 属性,但不需要。这是 Chrome 中的错误还是有原因? document.querySelector('dialo
我有一个 Electron 应用程序。如果我通常使用dialog.showmessageBoxSync,则必须等待用户输入。选项为:关闭,取消或确定。 它工作正常,但是如果我在对话框外部(应用程序内的
我有一个启动确认对话框的 View ,但代码不是等待对话框返回结果,而是直接跳转到 promise 的“then”部分。请参阅下面的代码: ConfirmDialog.ts import { inje
我有一个启动确认对话框的 View ,但代码不是等待对话框返回结果,而是直接跳转到 promise 的“then”部分。请参阅下面的代码: ConfirmDialog.ts import { inje
我正在使用 MonoTouch.Dialog 的 OwnerDrawnElement,但它似乎不允许用户在触摸屏幕时“突出显示”单元格。我查看了示例,但它没有显示突出显示。有什么建议么? 我注意到 T
此选择器在 http://jqueryui.com/demos/dialog/#modal-confirmation 中引用(源代码)。 $( "#dialog:ui-dialog" ).dialog
我有一个奇怪的问题。当 Activity 开始时,我会显示一个对话框,说明某些项目正在加载,如下所示: Dialog dialog; @Override public void onCreate(Bu
jquery-ui 中 .dialog("close") 和 .dialog("destroy") 有什么区别? 我有一个脚本,以前的开发人员使用了 .dialog("destroy") 但现在我必须
我正在使用 Acengage (Ad4Push),我想自定义它的对话框。 Acengage 团队说可以使用自定义主题更改对话框样式,我做到了。我可以更改 textSize、textColor、wind
我有一个标准 View ,顶部有一个导航栏。我还在它自己的源文件中设置了一个 Monotouch.Dialog。我四处寻找解决方案,但似乎找不到关于如何将 MTD 添加到普通 View 的明确答案。
我试图从一个打开的 md-dialog 中打开一个 md-dialog,但问题是第一个 md-dialog 在第二个打开时关闭了 // the controller of the first popU
我是一名优秀的程序员,十分优秀!