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

          <bdo id='YMhmV'></bdo><ul id='YMhmV'></ul>
        <tfoot id='YMhmV'></tfoot>
      1. <small id='YMhmV'></small><noframes id='YMhmV'>

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

      2. 如何在界面生成器中制作与 4 英寸 iPhone 兼容的

        时间:2023-05-31
        <tfoot id='x2WAe'></tfoot>

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

          • <small id='x2WAe'></small><noframes id='x2WAe'>

              • <bdo id='x2WAe'></bdo><ul id='x2WAe'></ul>

                  本文介绍了如何在界面生成器中制作与 4 英寸 iPhone 兼容的 uitableview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  如何在界面生成器中制作与 4 英寸 iphone5 和旧 iPhone 4/4s 兼容的 uitableview?

                  How do I make a uitableview in interface builder compatible with 4 inch iphone5, and the older iPhone 4/4s?

                  Xcode 4.5 中有三个选项:

                  There are three options in Xcode 4.5:

                  • 自由格式
                  • 视网膜 3.5 全屏
                  • 视网膜 4 全屏

                  如果我选择 Retina 4,那么在 3.5 英寸手机中它会越过/溢出屏幕边框

                  If I chose Retina 4, then in the 3.5 inch phone it crosses/overflows the screen border

                  使用代码,我可以相应地设置框架,但是使用界面生成器有什么用呢?

                  Using code, I can set the frame accordingly, but then what is the use of using interface builder?

                  应该如何使用 Interface Builder?

                  How should one do it using Interface Builder?

                  编辑

                  我的问题是 iPhone 5 Retina 4 英寸屏幕.在检查具有状态栏和导航栏的视图的大小时,这里是 self.view.frame.size.height/width 的值,如果我选择 freeform/none/retina 3.5,框架为 320.000000 x 416.000000

                  My question is for iphone 5 retina 4 inch screen. When inspecting the size of the view which has a status bar and navigation bar, here is the value of self.view.frame.size.height/width, frame 320.000000 x 416.000000 in case I choose freeform/none/retina 3.5

                  设置了自动调整大小选项,以便视图向所有方向扩展,即启用所有支柱和弹簧.

                  The autoresizing options are set so that the view expands in all directions, that is all struts and springs are enabled.

                  编辑为了在 iOS6 模拟器中进行测试,如果我在代码中设置以下内容

                  EDIT For testing in iOS6 simulator, If I set the following in code

                  self.tableView.frame    = CGRectMake(0, 0, 320, 546);
                  self.tableView.bounds   = CGRectMake(0, 0, 320, 546);
                  self.view.frame         = CGRectMake(0, 0, 320, 546);
                  self.view.bounds        = CGRectMake(0, 0, 320, 546);
                  NSLog(@"%2f - %2f", self.view.bounds.size.width, self.view.bounds.size.height);
                  NSLog(@"%2f - %2f", self.tableView.bounds.size.width, self.tableView.bounds.size.height);
                  

                  我得到以下输出

                   320.000000 - 546.000000
                   320.000000 - 546.000000
                  

                  并且从顶部算起 480 像素以下的所有行都是不可选择的,因为视图"仍然认为它们超出了界限.

                  And All the rows below the 480 px from the top are not selectable, as the 'view' still thinks they are out of bounds.

                  我的解决方案

                  将所有屏幕的大小设置为 Retina 4,包括主窗口 xib 文件.在此之后,即使在 iphone 4 上它似乎也能正常工作.并且所有低于 480px 的行现在都可以在 iOS 6 模拟器中点击

                  Set the size to Retina 4 for all screens, even the main window xib file. It seems to work fine even on the iphone 4 after this. And all rows below 480px are now clickable in iOS 6 simulator

                  推荐答案

                  注意如果您在应用程序中显示操作表,请将 size 属性设置为Retina 4 Full Screen".此解决方案实际上将主窗口的尺寸设置为 iPhone 5 的尺寸.在我的情况下,当您尝试显示操作表时在 iPhone 4 中设置此受影响的显示,因为它会尝试从可视屏幕下方显示它.

                  BEWARE of setting the size attribute to "Retina 4 Full Screen" if you present actionsheets in your application. This solution actually sets the dimensions of the main Window to the dimensions of the iPhone 5. In my case, setting this affected display in the iPhone 4 when you try to show an action sheet because it will try to show it from below the viewable screen.

                  适用于所有情况的正确解决方案是将大小设置为 none 并在应用程序委托 didfinishloading 方法中检测屏幕大小并将主窗口设置为该大小或将 rootviewcontroller 的视图设置为该大小.操作表将正常工作.

                  The proper solution that works for all cases is to set the size to none and detect the screensize in the app delegate didfinishloading method and set the main window to that size or set the rootviewcontroller's view to that size. Actionsheets will work correctly.

                  - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
                  
                  self.window.frame = CGRectMake(0, 0, [[UIScreen mainScreen]bounds].size.width, [[UIScreen mainScreen]bounds].size.height);
                  
                  }
                  

                  这篇关于如何在界面生成器中制作与 4 英寸 iPhone 兼容的 uitableview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:iOS 使用音量按钮作为输入 下一篇:使用 App Delegate 访问通过 Storyboard 创建的视图控制

                  相关文章

                  最新文章

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

                      <bdo id='1xkAk'></bdo><ul id='1xkAk'></ul>

                    1. <small id='1xkAk'></small><noframes id='1xkAk'>