我有一个UINavigationController(像一个向导页面一样)我以编程方式创建,我需要显示一个"取消"按钮来取消任何进程UIViewController.
创建UINavigationController:
FirstVC *firstVC = [[[FirstVC alloc] initWithNibName:@"FirstPage" bundle:nil] autorelease];
firstVC.delegate = self;
navigationController = [[UINavigationController alloc] initWithRootViewController:firstVC];
[self.view addSubview:navigationController.view];
Run Code Online (Sandbox Code Playgroud)
添加取消按钮:
UIBarButtonItem *cancelButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelRequestNewLeave:)];
navigationController.topViewController.navigationItem.rightBarButtonItem = cancelButton;
[cancelButton release];
Run Code Online (Sandbox Code Playgroud)
但当我按下第二页时UINavigationController,取消按钮上没有显示UINavigationBar.如果我回到第一页,取消按钮就在那里.所以,显然该按钮仅为第一个视图添加.我相信这是因为我不是子类UINavigationController,因为我需要在子视图中使用它.但我不知道如何设置rightBarButtonItem在UINavigationController其中编程方式创建.
navigationController.topViewController.navigationItem.rightBarButtonItem = cancelButton;
Run Code Online (Sandbox Code Playgroud)
有人可以对此有所了解吗?
提前致谢.
我正在使用CodeIgniter开发一个多语言网站.有一个表单将数据发布到控制器,但是$_POST当我开始使用土耳其字符öçüÜ?等时它是空的.
我将charset设置为:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Run Code Online (Sandbox Code Playgroud)
形成:
<form action="translations/save" method="post" accept-charset="utf-8">
<textarea rows="6" cols="60" id="editor_tr" name="editor_tr">Türkçe</textarea>
</form>
Run Code Online (Sandbox Code Playgroud)
$_POST并$this->input->post('editor_tr')返回空,但我可以看到原始帖子file_get_contents("php://input").
这个在普通的PHP测试中正常工作,但不适用于CodeIgniter.也许我的.htaccess文件导致了这个问题,但不知道.
任何帮助深表感谢.
更新:这是var_dump的请求输出.
var_dump($_POST) - 没有土耳其字符
array(3) { ["id"]=> string(12) "news8titleID" ["editor_tr"]=> string(13) "turkish value" ["editor_en"]=> string(13) "english value" }
Run Code Online (Sandbox Code Playgroud)
var_dump($_POST)- 使用土耳其字符(输入为:Türkçe karakter,但它没有显示在$ _POST中)
array(3) { ["id"]=> string(12) "news8titleID" ["editor_tr"]=> string(0) "" ["editor_en"]=> string(13) "english value" }
Run Code Online (Sandbox Code Playgroud)
更新2:
调试时,我发现system.core.Input该类清除了_clean_input_data函数的输入数据.
// Clean UTF-8 if supported …Run Code Online (Sandbox Code Playgroud)