Coder Social home page Coder Social logo

关于图片的显示 about interviewguide HOT 2 OPEN

notfound9 avatar notfound9 commented on July 17, 2024
关于图片的显示

from interviewguide.

Comments (2)

NotFound9 avatar NotFound9 commented on July 17, 2024

@mrhyh
您好!感谢您关注这个项目,不知道您说的是哪里的图片显示,如果是指图片模块中的每个cell中的搞笑图片,我是依据原图的宽高比来计算imageView的宽和高(宽是固定的,是屏幕的宽度,高是根据宽高比计算所得)
1.如果计算得到的高度在正常范围内(小于[UIScreen mainScreen].bounds.size.height-64-40)
那么会显示图片的全部,将imageView的contentMode设置为 UIViewContentModeScaleToFill;

2.如果计算得到的高度非常大(大于[UIScreen mainScreen].bounds.size.height-64-40)
如果计算的高度超出一定值,那么只会显示图片的中间部分,不需要裁剪和绘制,只需将imageView的contentMode设置为UIViewContentModeScaleAspectFill;
并且在imageView下方会有一个查看大图的按钮。

感谢您对TTNew的关注!谢谢!

from interviewguide.

mrhyh avatar mrhyh commented on July 17, 2024

明白了,谢谢楼主

from interviewguide.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.