问题标签 [universal]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
462 浏览

iphone - 如何:iPad 上的自动旋转和 iPhone 上的纵向?

嗨,我刚刚开始 iPhone 编程。我在 Xcode 3.2 中为 iPad 和 iPhone 创建了一个通用应用程序,并且 evrerything 工作正常。但现在我想在该应用程序中实现以下功能:

它应该支持 iPad 上的自动旋转,并且只在 iPhone 上是纵向的。

我不知道该怎么做。

我在共享选项卡下有一个 AppDelegate_iPad 委托文件、一个 AppDelegate_iPhone 委托文件和一个视图控制器,并且由这两个委托共享。

任何想法如何实现该功能。任何帮助,将不胜感激。

谢谢维克

0 投票
1 回答
196 浏览

ios - 如何在通用项目中添加仅适用于 iPhone 的类别

我有一个 iOS 通用项目,并按类别更改 UINavigationBar 背景(参考:http://stackoverflow.com/questions/1692487/how-to-add-background-image-on-iphone-navigation-bar)

之后,我发现Category改变了iPhone和iPad app,问题是,我如何只改变iPhone App Navigation Bar的背景图片,而iPad app使用默认的背景图片?

0 投票
3 回答
2277 浏览

ios - 具有本地化功能的通用应用程序 - 启动画面

我有一个带有一些本地化功能的通用应用程序。我的问题是关于闪屏。

我需要 6 个启动画面。iPad、iPhone、iPhoneRetina(英文)和 iPad、iPhone、iPhoneRetina(本地语言)

我有一个 iPad English Splash 文件,名为“Default.png”。当我在项目导航器上选择此文件时,我可以通过单击“+”号添加本地化版本。结果我有 2 个文件:Default.png(英语)和 Default.png(本地语言)到目前为止一切都很好。

但是当我尝试将“Default~iphone.png”文件添加到项目中时,它并没有被本地化。当我单击“+”号时,XCode 崩溃。

向项目添加 6 个(3 个设备 x 2 种语言)启动画面的正确方法是什么?

0 投票
1 回答
262 浏览

iphone - iphone, ipad, 通用应用设计, 基于拆分视图

我想构建通用应用程序。

我可以使用适用于通用应用程序的基于拆分视图的 iPad 应用程序吗?

0 投票
2 回答
100 浏览

iphone - 如何将仅 iPad 的应用程序转换为通用应用程序?

我最近写了一个 iPad 应用程序,我想制作一个通用应用程序。

做这个的最好方式是什么?我可以简单地创建两个版本的 XIB 文件并根据设备加载适当的 XIB 吗?

0 投票
1 回答
1071 浏览

iphone - 在 Xcode 4 中将 iPhone 应用程序转换为 Universal

我可以在这里使用一点清晰度。我打开了一个项目,它是一个完整的 iPhone 应用程序。然后选择目标,从摘要/设备下拉列表中选择“通用”,然后按照提示“制作通用应用程序”。Xcode 创建了一个文件夹“iPad”,其中包含文件“MainWindow-iPad.xib”。美好的。

现在我复制了所有其他 nib 文件,并在它们的名称后添加了“-iPad”。即“MySpecialVC.xib”被欺骗并重命名为“MySpecialVC-iPad.xib”。当时的想法是 Xcode 知道一些关于为设备找到正确 xib 的 zoodoo。不太好。

然后我读到“-iPad”必须是“~ipad”(波浪号,然后是小写的ipad)。这解决了一些 xib 的问题,但不是全部

如果我无法弄清楚这一点,该死。有正确的方法吗?

0 投票
2 回答
192 浏览

ios - 制作通用 iOS 应用程序应遵循的初始步骤

我正要启动一个通用的 iOS 应用程序。我只想使用界面生成器制作这个应用程序。

有人可以建议我如何安排两个 nib 文件吗?每当我创建一个类时,只会创建一个 xib 文件,但我想要两个 xib 文件,一个用于 iPhone,另一个用于 iPad 应用程序,因为这是一个通用应用程序。

您还可以建议哪种方法更好,即通过界面或使用编码为这个通用应用程序制作 UI。

0 投票
1 回答
1866 浏览

xcode - Is this a correct way of creating a universal iOS app? Xcode 4 - Seems to work?

Here is how I made a universal app from an existing iPhone project by creating ~ipad.xib(s) using duplicate and then adding them back to a backup of the project, and checking universal.

I used xcode 4.02 with a base sdk of 4.3.3 with a deployment target of 3.1.2.

  1. Back up your whole project somewhere.
  2. Right click on iPhone target and choose duplicate. Choose duplicate for iPad rather than just duplicate. This makes a new folder called Resources-iPad with a subfolder called classes under that, and under that are copies of all the xib files in the entire project. (The funny thing is that when I look at these files in finder they don't have an .xib extension although they show an extension in the xcode window - why? Finder still says they are xib files anyway though.)
  3. At this point I had two targets. This seemed wrong so I went to finder and made a backup copy of the new Resources-iPad folder, and then deleted the whole project.
  4. Copy back the original iPhone project I had backed up up in step 1.
  5. Added the Resources-iPad folder that was backed up, and edited them so they looked good for iPad.
  6. I now had one target which seemed good, and I made it a universal device instead of iPhone in the target summary.
  7. However, I got inconsistent behavior when deploying to the simulator or device - sometimes the wrong xib would be used for no apparent reason.
  8. This fixed it - in xcode, in the Resources-iPad/classes folder rename all the xibs for ipad from mynibname.xib to mynibname~ipad.xib (tilda in front and all lowercase)

I couldn't find any documentation on whether it is OK to do it this way. It works on these physical devices so far:

iPad 2 with 4.3, iPod touch v1 with 3.1.2, iPod touch v4 (retina) with 4.1

Is this a correct way of creating a universal app? It seems easy enough now that I have this worked out, but took forever to find this info. Oh also I do not have a mainwindow.xib but other nibs that get loaded elsewhere as tableview section headers and detail views in a tabbar app - so I left the main interface sections blank.

Oh - I don't have an iPad 1 and cant test on that device, but it doesn't seem to work right in the iPad 3.2 Simulator, but all other devices and simulators appear to work OK.

0 投票
1 回答
651 浏览

jquery - 使我的 Jquery 代码适合所有带有 class="trigger" 的链接。无法让 next() 发挥作用

html:

当我这样做时,我得到了 jquery 代码:

但是希望它在类触发器的多个链接上工作......那么我如何重写代码以在多个地方工作?

示例:(无法使其正常工作...)

html:

jQuery:

帮我简化代码谢谢!:)

0 投票
2 回答
205 浏览

iphone - 将 iphone 应用程序转换为通用问题?

我已将我的应用程序转换为 xCode 4 中的通用应用程序。这自动创建了我的 MainWindow-iPad.xib 并修改了我的 info.plist 以包含我的主 Nib 文件基本名称的 iPad 版本....(MainWindow-iPad )。

可悲的是,我的应用程序似乎仍在使用我的 iPhone 版本的 MainWindow.xib。

这不可能。我的目标设置为通用。

谁能建议为什么我的 iPad 版本没有被使用?

谢谢