• IOS适配


    • Default.png(图片尺寸为320x480):显示在非Retina-3.5英寸屏幕上(iPhone3GiPhone3GS,屏幕分辨率为320x480)

    • Default@2x.png(图片尺寸为640x960):显示在Retina-3.5英寸屏幕上(iPhone4iPhone4s,屏幕分辨为640x960)

    • Default-568h@2x.png(图片尺寸为640x1136):显示在Retina-4.0英寸屏幕上(iPhone5,屏幕分辨率为640x1136)

    一、高度适配

    iPhone5的尺寸是640x1136,iPhone4的尺寸是640x960,多出来的176px如何处理?
    那么原先iPhone4的app程序都要如何去适配新的iPhone5界面呢??

    答:以前不考虑iphone5的时候,我们写一个页面最下方的UIButton。会这么写:
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, 460-44, 320, 44)];
    现在考虑iphone5的长屏幕,就需要这么写:
    UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height-44, 320, 44)];
    以前固定的高度,现在需要自动获取了。

  • 相关阅读:
    AS3 判断双击事件
    php 数据类型转换与比较
    几行几列算法
    CCNode的属性说明
    bitmapdata的知识点
    addFrameScript用法
    TweenMax.allTo
    flash TweenMax用法
    flash流媒体资料
    c实现windows socket
  • 原文地址:https://www.cnblogs.com/thinksasa/p/3689042.html
Copyright © 2020-2023  润新知