第二次加载时自定义UIImagePickerController问题(Customized UIImagePickerController issue when loaded a second time)
我已经制作了一个带有自定义叠加视图的UIImagePickerController,以便增强界面,并且在我第一次加载它时效果很好,它非常完美。 问题是如果我解雇它然后再显示它我有一个奇怪的错误。 摄像机视图和叠加层显示在导航栏和前一个视图控制器的TabBar后面。
我尝试了不同的实现方法,但我无法解决这个问题。
这是我如何调用我的UIImagePickerController。 它的灵感来自这个示例代码 。
[self.cameraOverlayViewController setupImagePicker:UIImagePickerControllerSourceTypeCamera]; [self presentModalViewController:self.cameraOverlayViewController.imagePickerController animated:YES];
拍完照片后,我解雇了UIImagePickerController:
[self dismissModalViewControllerAnimated:YES];
绝对没有什么特别的实施方式。
这里有两个截图:
现在采取第二次发布: 第二次发布http://puic.dev.madebykawet.com/IMG_0929.PNG
谢谢你的回答!
I have made a UIImagePickerController with a custom overlay view in order to enhance the interface and it's working great the first time I load it, it's perfect. The problem is that if I dismiss it and then shows it again I have a strange bug. the camera view and the overlay appear behind the NavBar and the TabBar of the previous view controller.
I have try different ways of implementing this but I can't get this bug solved.
Here is how I call my UIImagePickerController. It's inspired by this sample code.
[self.cameraOverlayViewController setupImagePicker:UIImagePickerControllerSourceTypeCamera]; [self presentModalViewController:self.cameraOverlayViewController.imagePickerController animated:YES];
Once my picture taken, I dismiss the UIImagePickerController:
[self dismissModalViewControllerAnimated:YES];
Definitly nothing special in the way of implementing it.
And here 2 screenshots:
And now taken at second launch: At second launch http://puic.dev.madebykawet.com/IMG_0929.PNG
Thanks for your answers !
原文:https://stackoverflow.com/questions/6384846
最满意答案
在整个程序中,YourNewUser和YourNewPass变量被初始化为0。 问题是,一旦你输入一个函数,这些变量就不一定是函数可以访问的。 在函数中设置YourNewUser和YourNewPass时,它不会更改整个程序中同名的变量。 它们是两个不同的变量,即使它们具有相同的名称。
解决此问题的一种方法是让函数在末尾的列表中返回重置用户名和密码,然后根据返回列表的索引设置用户名和密码。 例如:
NewPass = ChangedPass() YourNewUser = NewPass[0] yourNewPass = NewPass[1]
The YourNewUser and YourNewPass variables are being initialized to 0 in the overall program. What the issue is, once you enter a function, those variables are not necessarily accessible by the function. When you set YourNewUser and YourNewPass in the function, it does not change the variables of the same name in the overall program. They are two different variables even though they have the same name.
One way to get around this is to have the function return the reset username and password in a list at the end and then set the username and password based on the index of the returned list. For example:
NewPass = ChangedPass() YourNewUser = NewPass[0] yourNewPass = NewPass[1]
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
要在UITextField中禁用编辑,您需要在委托方法textFieldShouldBeginEditing:返回NO textFieldShouldBeginEditing: - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField{ return NO; } 要在UITextView中将editable属性设置为editable为NO : [textView setEditable:NO]; To disable editing ...
-
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
提交你的修复,然后使用git rebase --interactive来重新排序你的提交并压缩两个提交。 有关详细信息,请参阅git书 。 请注意,如果这些提交已经被推到一些地方,那么这样做是个坏主意,因为您将更改存储库历史记录。 示例会话可能如下所示: % git init Initialized empty Git repository in /home/user/repo/.git/ % echo "A line" > a.txt % echo "A line" > b.txt % git add a ...
-
Word无法编辑范围(Word Cannot Edit Range)[2023-09-24]
使用提供给这个问题的编辑,我能够按照我想要的方式工作: 如何在编辑文本值后将书签保留为书签? if (doc.Bookmarks.Exists(fieldName)) { doc.FormFields[fieldName].Result = text; } Using the edit provided to this question I was able to get it to work the way I wanted: How can I keep bookmarks as bookma ... -
在PHP中编辑cron [重复](Edit cron in PHP [duplicate])[2022-02-01]
你可以使用一些命令来: export current crontab: crontab -l > /some/file 通过php编辑此文件来做自己的烹饪 告诉cron使用您编辑的文件: crontab /some/file 使用exec()运行这些命令应该没问题。 似乎还有一些库可以为你做这些,比如Jobby ...... you can use some commands to: export current crontab: crontab -l > /some/file do your own co ... -
我可以使用变量的值作为新变量吗?(can I use a variable's value as a new variable? How I can do that? [duplicate])[2023-08-23]
你可以使用globals() >>> a = 'rajiv' >>> globals()[a] = 1 >>> rajiv 1 You could use globals() >>> a = 'rajiv' >>> globals()[a] = 1 >>> rajiv 1 -
在整个程序中,YourNewUser和YourNewPass变量被初始化为0。 问题是,一旦你输入一个函数,这些变量就不一定是函数可以访问的。 在函数中设置YourNewUser和YourNewPass时,它不会更改整个程序中同名的变量。 它们是两个不同的变量,即使它们具有相同的名称。 解决此问题的一种方法是让函数在末尾的列表中返回重置用户名和密码,然后根据返回列表的索引设置用户名和密码。 例如: NewPass = ChangedPass() YourNewUser = NewPass[0] yourNe ...
-
使用“附加到进程”开始调试时不支持“编辑并继续”。混合模式,组合托管和本机,调试,SQL调试,Compact Framework(智能设备)项目,Windows 98上的调试不支持编辑和继续,或64位调试。“ http://msdn.microsoft.com/en-us/library/ba77s56w.aspx 编辑 - 该链接说VB,但我确信我在使用c#时遇到了混合本机和托管代码以及64位调试的相同问题。 "Edit and Continue is not supported when you sta ...
-
在编辑文本时使用TextWatcher et1.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void onTextChanged(CharSequence s, in ...