Is it important to design iPhone App layouts flexible?

后端 未结 6 1876
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 04:43

I am wondering if I would run into troubles when setting the heights of my views in the neb with fixed values.

Example: The height of the Status Bar is known. It\'s

6条回答
  •  我在风中等你
    2021-01-06 04:47

    Aren't most of these size present in the Apple supplied file "Constants.h"? (I've just noticed that it is part of the UICatalog SDK example).

    I think it is very likely that Apple will launch another device sometime which has a larger or smaller screen. So they should be used in conjunction with [UIScreen frame/bounds];

    // these are the various screen placement constants used across all the UIViewControllers
    
    // padding for margins
    #define kLeftMargin             20.0
    #define kTopMargin              20.0
    #define kRightMargin            20.0
    #define kBottomMargin           20.0
    #define kTweenMargin            10.0
    
    // control dimensions
    #define kStdButtonWidth        106.0
    #define kStdButtonHeight        40.0
    #define kSegmentedControlHeight 40.0
    #define kPageControlHeight      20.0
    #define kPageControlWidth      160.0
    #define kSliderHeight            7.0
    #define kSwitchButtonWidth      94.0
    #define kSwitchButtonHeight     27.0
    #define kTextFieldHeight        30.0
    #define kSearchBarHeight        40.0
    #define kLabelHeight            20.0
    #define kProgressIndicatorSize  40.0
    #define kToolbarHeight          40.0
    #define kUIProgressBarWidth    160.0
    #define kUIProgressBarHeight    24.0
    
    // specific font metrics used in our text fields and text views
    #define kFontName               @"Arial"
    #define kTextFieldFontSize      18.0
    #define kTextViewFontSize       18.0
    
    // UITableView row heights
    #define kUIRowHeight            50.0
    #define kUIRowLabelHeight       22.0
    
    // table view cell content offsets
    
    #define kCellLeftOffset          8.0
    #define kCellTopOffset          12.0
    

    Tony

提交回复
热议问题