Skip to content
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

使用ShapeRelativeLayout的时候给布局设置宽度为wrap_content minWidth="60dp" 通过代码修改该布局的setStrokeWidth和setStrokeColor 布局宽度会直接撑满 #45

Closed
sdjwj1118 opened this issue Sep 3, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@sdjwj1118
Copy link

【警告:请务必按照 issue 模板填写,不要抱有侥幸心理,一旦发现 issue 没有按照模板认真填写,一律直接关闭】

问题描述

  • 框架版本【必填】:8.3

  • 问题描述【必填】:使用ShapeRelativeLayout的时候给布局设置宽度为wrap_content minWidth="60dp" 通过代码修改该布局的setStrokeWidth和setStrokeColor 布局宽度会直接撑满

  • 复现步骤【必填】:给ShapeRelativeLayout设置最小宽度 再通过代码修改边框和(注意:目前不受理没有复现步骤的 Bug 单)

  • 是否必现【必填】:填是/否 是

  • 出现问题的手机信息【必填】:请填写出现问题的品牌和机型 小米10u

  • 出现问题的安卓版本【必填】:请填写出现问题的 Android 版本 android 12

请回答

  • 是部分机型还是所有机型都会出现【必答】:部分/全部(例如:某为,某 Android 版本会出现)所有

  • 框架最新的版本是否存在这个问题【必答】:是/否(如果用的是旧版本的话,建议升级看问题是否还存在)是

  • 是否已经查阅框架文档还未能解决的【必答】:是/否(文档会提供最常见的问题解答,可以看看是否有自己想要的)是

  • issue 是否有人曾提过类似的问题【必答】:是/否(看看曾经有人提过类似的问题,先参考一下别人是怎么解决的)否

  • 是否可以通过 Demo 来复现该问题【必答】:是/否(排查一下是不是自己的项目代码写得有问题导致的)是

  • 使用原生的 shape.xml 来实现是否也会出现该问题【必答】:是/否(排查一下是不是框架的代码存在问题导致的)否

其他

  • 提供报错堆栈(如果有报错的话必填,注意不要拿被混淆过的代码堆栈上来)

  • 提供截图或视频(根据需要提供,此项不强制)

a542485497e3867c265e2ca33e68ccb
e686a64a05504fb48be9c5752327ae8

  • 提供解决方案(如果已经解决了的话,此项不强制)
@sdjwj1118 sdjwj1118 added the bug Something isn't working label Sep 3, 2022
@sdjwj1118 sdjwj1118 changed the title ShapeRelativeLayout设置minWidth 再动态修改边框的时候布局会直接撑满 使用ShapeRelativeLayout的时候给布局设置宽度为wrap_content minWidth="60dp" 通过代码修改该布局的setStrokeWidth和setStrokeColor 布局宽度会直接撑满 Sep 3, 2022
@getActivity
Copy link
Owner

image

image

screenshot1662272565526

@getActivity
Copy link
Owner

image

@sdjwj1118 按照你说的步骤进行操作,我并没有复现到该问题,需要你这边提供一个可供复现的 Demo 工程到这里来。

@sdjwj1118
Copy link
Author

已解决 是我布局的问题。还有个问题反馈下 使用shapebutton 文字居中 但实际文字是会偏高一点
image

@getActivity
Copy link
Owner

@sdjwj1118 小伙子,你换成原生的 shape.xml 是否也有同样的问题。

@getActivity
Copy link
Owner

超过三天没有响应,自动关闭此 issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants