V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
astnd
V2EX  ›  iDev

有没有iOS (主要是iPhone)上各个控件的尺寸和位置的标准? 比如NavigationBar上的左右按钮的精确位置这样?

  •  
  •   astnd · 2013-02-21 21:31:41 +08:00 · 9234 次点击
    这是一个创建于 4081 天前的主题,其中的信息可能已经有所发展或是发生改变。
    7 条回复    1970-01-01 08:00:00 +08:00
    microrz
        1
    microrz  
       2013-02-21 21:33:23 +08:00
    alexrezit
        2
    alexrezit  
       2013-02-21 21:56:17 +08:00   ❤️ 1
    这些值都是可以动态获取的, 不要写死了, 不然遇上改 UI 累死你.
    如果只是想获取系统的按钮的话, 因为 navigation bar 上的按钮是 UIBarButtonItem 类的, 所以位置和大小是按内容自动生成的, 获取时也需要通过 UIEvent 获取.
    例如:
    - (void)myButtonPressed:(UIBarButtonItem *)button event:(UIEvent *)event
    {
    NSLog(@"%@", [event.allTouches.anyObject view]);
    }
    输出:
    <UINavigationButton: 0x71cf400; frame = (281 7; 34 30); opaque = NO; layer = <CALayer: 0x718e950>>
    (这是一个位于 navigation bar 右侧使用了 refresh 系统图标的按钮)
    当然还有很多其他方法, 就不一一列举了.
    astnd
        3
    astnd  
    OP
       2013-02-21 22:18:48 +08:00
    @alexrezit thx 非常有用。 但是还是想在画UI的时候知道一下确切的位置这样、、
    alexrezit
        4
    alexrezit  
       2013-02-21 23:03:13 +08:00   ❤️ 3
    @astnd
    不用在初期就过度设计, 因为到最后你会发现还得改好多次才会成型.
    在 Mac 上设计 UI 即使有像 http://www.teehanlax.com/ 这种 UI Elements 的 psd 档也很麻烦. 我个人觉得不管是逻辑还是 UI 还是纸上来得舒服. 喜欢在纸面设计的话推荐 http://sukikits.taobao.com .
    chisj
        5
    chisj  
       2013-02-22 12:38:08 +08:00
    @alexrezit 已感谢,有帮助。
    BB9z
        7
    BB9z  
       2013-02-22 21:27:46 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1340 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:43 · PVG 01:43 · LAX 10:43 · JFK 13:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.