zoukankan      html  css  js  c++  java
  • 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)];
    以前固定的高度,现在需要自动获取了。

  • 相关阅读:
    JSTL标签
    EL(表达式语言)
    JDBC技术
    Java中的一些术语的解释
    Servlet过滤器和监听器
    MVC-初识
    EF-初识
    .NET细节知识总结,不断更新
    多线程-Task、await/async
    多线程-Thread和ThreadPool
  • 原文地址:https://www.cnblogs.com/thinksasa/p/3689042.html
Copyright © 2011-2022 走看看