<bdo id='LLqbc'></bdo><ul id='LLqbc'></ul>
<i id='LLqbc'><tr id='LLqbc'><dt id='LLqbc'><q id='LLqbc'><span id='LLqbc'><b id='LLqbc'><form id='LLqbc'><ins id='LLqbc'></ins><ul id='LLqbc'></ul><sub id='LLqbc'></sub></form><legend id='LLqbc'></legend><bdo id='LLqbc'><pre id='LLqbc'><center id='LLqbc'></center></pre></bdo></b><th id='LLqbc'></th></span></q></dt></tr></i><div id='LLqbc'><tfoot id='LLqbc'></tfoot><dl id='LLqbc'><fieldset id='LLqbc'></fieldset></dl></div>
    1. <legend id='LLqbc'><style id='LLqbc'><dir id='LLqbc'><q id='LLqbc'></q></dir></style></legend>

      1. <tfoot id='LLqbc'></tfoot>

      2. <small id='LLqbc'></small><noframes id='LLqbc'>

        iPhone 模态视图比屏幕小

        时间:2023-05-16
      3. <tfoot id='Czq6G'></tfoot>

            <tbody id='Czq6G'></tbody>
        • <small id='Czq6G'></small><noframes id='Czq6G'>

              • <bdo id='Czq6G'></bdo><ul id='Czq6G'></ul>
                <i id='Czq6G'><tr id='Czq6G'><dt id='Czq6G'><q id='Czq6G'><span id='Czq6G'><b id='Czq6G'><form id='Czq6G'><ins id='Czq6G'></ins><ul id='Czq6G'></ul><sub id='Czq6G'></sub></form><legend id='Czq6G'></legend><bdo id='Czq6G'><pre id='Czq6G'><center id='Czq6G'></center></pre></bdo></b><th id='Czq6G'></th></span></q></dt></tr></i><div id='Czq6G'><tfoot id='Czq6G'></tfoot><dl id='Czq6G'><fieldset id='Czq6G'></fieldset></dl></div>
                <legend id='Czq6G'><style id='Czq6G'><dir id='Czq6G'><q id='Czq6G'></q></dir></style></legend>

                  本文介绍了iPhone 模态视图比屏幕小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  我正在尝试做一些不应该那么复杂的事情,但我想不通.我有一个 UIViewController 显示一个 UITableView.我想在用户按下一行时显示一个上下文菜单.我希望这是一个带有标签和按钮的半透明视图.我可以使用 AlertView,但我想完全控制标签和按钮的格式,并希望使用 Interface Builder.

                  I'm trying to do something that shouldn't be that complicated, but I can't figure it out. I have a UIViewController displaying a UITableView. I want to present a context menu when the user press on a row. I want this to be a semi-transparent view with labels and buttons. I could use an AlertView, but I want full control on the format of the labels and buttons and will like to use Interface Builder.

                  所以我创建了 250x290 的小视图,将 alpha 设置为 0.75,并创建了一个带有插座的视图控制器来处理不同的用户事件.

                  So I created my small view 250x290, set the alpha to .75 and create a view controller with the outlets to handle the different user events.

                  现在我想介绍它.如果我使用 presentModalViewController 会发生两个(不希望的)事情1)视图覆盖了整个屏幕(但状态栏除外).2) 它是半透明的,但我在它后面"看到的不是父视图,而是应用程序根视图.

                  Now I want to present it. If I use presentModalViewController two (undesired) things happen 1) the view covers all of the screen (but the status bar). 2) It is semi-transparent, but what I see "behind" it its not the parent view but the applications root view.

                  我尝试将其添加为子视图,但没有任何反应,所以我做的不对:

                  Ive tried adding it as a subview, but nothing happens, so Im not doing something right:

                  RestaurantContextVC* modalViewController = [[[RestaurantContextVC alloc] initWithNibName:@"RestaurantContextView" bundle:nil] autorelease];
                  [self.view addSubview:modalViewController.view];
                  

                  有可能做我想做的事吗?提前致谢.

                  Is it possible to do what I want? Thanks in advance.

                  贡索

                  推荐答案

                  我正在编写类似的代码.我的方法包括.....

                  I'm coding similar thing. My approach include.....

                  1. 不使用dismissModalViewControllerAnimated 和presentModalViewController:animated.

                  1. Not using dismissModalViewControllerAnimated and presentModalViewController:animated.

                  在 IB 中设计定制的全尺寸视图.在其 viewDidLoad 消息体中,将背景颜色设置为 clearColor,以便视图上未被控制器覆盖的空间是透明的.

                  Design a customized full sized view in IB. In its viewDidLoad message body, set the background color to clearColor, so that space on the view not covered by controllers are transparent.

                  我在浮动视图的控制器下放了一个 UIImageView.UIImageView 包含一个经过 photoshop 处理的图像,该图像具有圆角并且背景设置为透明.此图像视图用作容器.

                  I put a UIImageView under the controllers of the floating view. The UIImageView contains a photoshoped image, which has rounded corners and the background is set to transparent. This image view serves as the container.

                  我使用 CoreAnimation 以模态视图样式呈现/关闭浮动视图:(FloatingViewController.m)

                  I uses CoreAnimation to present/dismiss the floating view in the modal view style: (the FloatingViewController.m)

                  -  (void)viewDidLoad
                  {
                      [super viewDidLoad];
                      [self.view setBackgroundColor:[UIColor clearColor]];
                  
                      [UIView beginAnimations:nil context:nil];
                      [self.view setFrame:CGRectMake(0, 480, 320, 480)];
                  
                      [UIView setAnimationDuration:0.75f];
                      [self.view setFrame:CGRectMake(0, 0, 320, 480)];
                      [UIView commitAnimations];
                  }
                  

                  这篇关于iPhone 模态视图比屏幕小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:iOS 7中文本字段的弹出/模式选择器 下一篇:NSApp 的 ModalForWindow、NSAlert 的 ModalForWindow 和 ModalSessi

                  相关文章

                  <small id='mIgii'></small><noframes id='mIgii'>

                  <legend id='mIgii'><style id='mIgii'><dir id='mIgii'><q id='mIgii'></q></dir></style></legend>

                        <bdo id='mIgii'></bdo><ul id='mIgii'></ul>
                    1. <i id='mIgii'><tr id='mIgii'><dt id='mIgii'><q id='mIgii'><span id='mIgii'><b id='mIgii'><form id='mIgii'><ins id='mIgii'></ins><ul id='mIgii'></ul><sub id='mIgii'></sub></form><legend id='mIgii'></legend><bdo id='mIgii'><pre id='mIgii'><center id='mIgii'></center></pre></bdo></b><th id='mIgii'></th></span></q></dt></tr></i><div id='mIgii'><tfoot id='mIgii'></tfoot><dl id='mIgii'><fieldset id='mIgii'></fieldset></dl></div>
                    2. <tfoot id='mIgii'></tfoot>