【问题标题】:Different Android Screens, Different colors, can we program screens to look the same?不同的 Android 屏幕,不同的颜色,我们可以将屏幕编程为看起来相同吗?
【发布时间】:2020-02-23 23:49:19
【问题描述】:

是否可以有一个动态配色方案来调整每个设备的显示类型?屏幕之间的灰色可能看起来不同,我想知道是否有一种有效的方法可以在屏幕颜色之间创建相似的外观。

【问题讨论】:

    标签: android dynamic themes display


    【解决方案1】:

    抓住屏幕的演说并创造一种颜色。

    DisplayMetrics displaymetrics = new DisplayMetrics();
            getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);
            int height = displaymetrics.heightPixels;
            int width = displaymetrics.widthPixels;
            float oration = height / width;
    
          Color backgroundColor = new Color();
          backgroundColor.red(Math.abs(Integer.valueOf((String.valueOf(oration)))*10));
        ........
    

    【讨论】:

    • 你能解释一下如何划分高度/宽度会给我一个影响我们在屏幕上看到的颜色的视觉比例的因素吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-10
    • 1970-01-01
    相关资源
    最近更新 更多