Giter Club home page Giter Club logo

android_layout_pixels's Introduction

                                                    自定义像素

在android开发中,通常我们的设计师提供的ui基本上是参照iphone6(分辨率为750x1334),但是android设备碎片化极其严重,如何才能100%的还原我们的

页面上的控件的尺寸呢,这里我们的解决方案是通过自定义view的方式来解决;

我们以750x1334为例的的一个宽高为375px的控件,在750x1334分辨率的设备上显示为宽度为屏幕宽度的一半,那么在其他分辨率的设备上显示的效果?比如在

1080x1920中,如何显示效果和在750x1334中一致呢?

int width=1080/750 x375=540,正好为屏幕宽度(1080x1920)的一半。 所有我们在布局测量的时候,动态的计算像素,来达到适配不同分辨率。

android_layout_pixels's People

Contributors

forever001 avatar

Watchers

James Cloos avatar

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.