Git Product home page Git Product logo

Comments (2)

manondidi avatar manondidi commented on June 11, 2024

只保留xxhdpi的资源
使用字节跳动的适配方案,即篡改设备的像素密度参数 density,
可以使UI中写死dp的部分在不同的设备上随着屏幕宽度缩放,致使页面最终效果和UI设计图上和屏幕的比例一致

可以使用android新出的 约束布局 减少页面中需要用线性布局和相对布局嵌套实现的效果,但是线性布局和相对布局中直接能实现的,不需要用约束布局 因为约束布局更占用内存

另外可以根据横屏和竖屏的区别, 在屏幕上添加不同的fragment实现不同的布局

可以使用kotlin的 扩展功能 去扩展Float, 这样可以直接优雅的使用 xxx.dp() 实现px和dp的转换

from android-daily-interview.

df13954 avatar df13954 commented on June 11, 2024

头条方案~~

from android-daily-interview.

Related Issues (20)

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.