JessYanCoding / JessYanCoding/AndroidAutoSize

重写了getResources与generateLayoutparams,依旧会出现局部适配失效的问题

未關閉
#416 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Java
星號
13.7k
分支
2k
PR 合併指標
30 天內沒有已合併 PR

描述

作者你好,我在activity的getResources方法中重新设置了density,也重写了generateLayoutParams方法重新设置density值,但是依旧会出现局部适配失效的问题,如下图,输入框部分异常变大,且该问题非必现:
![1](https://user-images.githubusercontent.com/9522880/179889799-660a8d0c-f617-418e-89b3-79f0c03badbb.png)
![2](https://user-images.githubusercontent.com/9522880/179889810-499f7155-1bf6-473a-9664-fe119806275b.png)

变大部分的xml中,最上层标签是merge,然后就是我自定义的父布局,重写了generateLayoutParams方法重新设置density值。
![3](https://user-images.githubusercontent.com/9522880/179890031-73a62432-817c-4801-a307-f441bdd0be8e.jpg)
请问下,是否是我使用的方式不对,需要在每一个viewGroup都重写generateLayoutParams方法?或者有没有其他的方式来避免这个问题

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Start with the Activity getResources override and the custom parent layout's generateLayoutParams implementation described in the issue. Reproduce the intermittent sizing failure using the merge-root XML and affected input field, then trace which layout path does not receive the intended density. Done means identifying the supported adaptation path and documenting or fixing the case without requiring every ViewGroup to be overridden.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
android, java
領域
mobile-dev
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。