-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
重写了getResources与generateLayoutparams,依旧会出现局部适配失效的问题 #416
Comments
排查一下啊,是否有采用getLayoutParams()方法动态设置宽高,而又没考虑density呢? |
这个变高的地方没有使用getLayoutParams的方式设置高度。不过我只在外层的viewgroup重写了generateLayoutParams,这个变高的自定义布局没重写,就像我问题描述的那样,不清楚是不是要每层都重写。 |
您好,看一下有没有用第三方库处理图片之类的?
…------------------ Original ------------------
From: "JessYanCoding/AndroidAutoSize" ***@***.***>;
Date: Wed, Aug 17, 2022 04:58 PM
***@***.***>;
***@***.******@***.***>;
Subject: Re: [JessYanCoding/AndroidAutoSize] 重写了getResources与generateLayoutparams,依旧会出现局部适配失效的问题 (Issue #416)
排查一下啊,是否有采用getLayoutParams()方法动态设置宽高,而又没考虑density呢?
这个变高的地方没有使用getLayoutParams的方式设置高度。不过我只在外层的viewgroup重写了generateLayoutParams,这个变高的自定义布局没重写,就像我问题描述的那样,不清楚是不是要每层都重写。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
问题里这个放大的地方是一个viewgroup。项目中有用Glide加载图片,有用density * size的方式重新设置imageview大小。 |
AutoSize框架下使用glide、picasso加载图片好像会出问题,具体可以看下issue,有不少例子。
…------------------ Original ------------------
From: "JessYanCoding/AndroidAutoSize" ***@***.***>;
Date: Thu, Aug 18, 2022 06:26 PM
***@***.***>;
***@***.******@***.***>;
Subject: Re: [JessYanCoding/AndroidAutoSize] 重写了getResources与generateLayoutparams,依旧会出现局部适配失效的问题 (Issue #416)
您好,看一下有没有用第三方库处理图片之类的?
…
------------------ Original ------------------ From: "JessYanCoding/AndroidAutoSize" @.>; Date: Wed, Aug 17, 2022 04:58 PM @.>; @.@.>; Subject: Re: [JessYanCoding/AndroidAutoSize] 重写了getResources与generateLayoutparams,依旧会出现局部适配失效的问题 (Issue #416) 排查一下啊,是否有采用getLayoutParams()方法动态设置宽高,而又没考虑density呢? 这个变高的地方没有使用getLayoutParams的方式设置高度。不过我只在外层的viewgroup重写了generateLayoutParams,这个变高的自定义布局没重写,就像我问题描述的那样,不清楚是不是要每层都重写。 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
问题里这个放大的地方是一个viewgroup。项目中有用Glide加载图片,有用density * size的方式重新设置imageview大小。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
作者你好,我在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方法?或者有没有其他的方式来避免这个问题
The text was updated successfully, but these errors were encountered: