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

[Bug]:ShapeTextView使用问题 #92

Open
MrHayden opened this issue Sep 11, 2024 · 11 comments
Open

[Bug]:ShapeTextView使用问题 #92

MrHayden opened this issue Sep 11, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@MrHayden
Copy link

框架版本【必填】

9.2

问题描述【必填】

ShapeTextView使用shape_textStrokeSize和shape_textStrokeColor时,设置字体颜色发现只能使用shape_textStartColor和shape_textEndColor才能生效,但是如果设置渐变色后Android属性不生效。
想实现字体能居中并且文字有颜色和描边颜色

复现步骤【必填】

<com.hjq.shape.view.ShapeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="哈哈哈哈哈\n久啊感受到噶几送给大家阿嘎是哒"
android:textColor="#0fffff"
app:shape_textColor="#0fffff"
app:shape_textStartColor="#0fffff"
app:shape_textEndColor="#0fffff"
app:shape_textStrokeColor="#240098"
app:shape_textStrokeSize="1dp"/>

这里的代码文字不会居中,请问怎么写呢

是否必现【必填】

项目 targetSdkVersion【必填】

34

出现问题的手机信息【必填】

OnePlus MT2110

出现问题的安卓版本【必填】

34

问题信息的来源渠道【必填】

自己遇到的

是部分机型还是所有机型都会出现【必答】

所有

框架最新的版本是否存在这个问题【必答】

框架文档是否提及了该问题【必答】

是否已经查阅框架文档但还未能解决的【必答】

issue 列表中是否有人曾提过类似的问题【必答】

是否已经搜索过了 issue 列表但还未能解决的【必答】

是否可以通过 Demo 来复现该问题【必答】

提供报错堆栈

No response

提供截图或视频

image
字体不居中

提供解决方案

No response

@MrHayden MrHayden added the bug Something isn't working label Sep 11, 2024
@getActivity
Copy link
Owner

getActivity commented Sep 12, 2024

ShapeView-9.3.aar.zip

@getActivity
Copy link
Owner

getActivity commented Sep 12, 2024

小伙子,我针对你说的这个问题进行了优化,你下载上面的 aar 包测试一下,有问题再与我我反馈,没有问题的话也说一声,我发布一下远程依赖版本。

@MrHayden
Copy link
Author

好的,我测试一下,谢谢轮子哥

@MrHayden
Copy link
Author

MrHayden commented Sep 13, 2024

小伙子,我针对你说的这个问题进行了优化,你下载上面的 aar 包测试一下,有问题再与我我反馈,没有问题的话也说一声,我发布一下远程依赖版本。

轮子哥,换了您的发的aar文件发现还是不行
image

@MrHayden
Copy link
Author

文字在view的容器内没有水平居中,是start对齐的,实际想要的效果是
image

@getActivity
Copy link
Owner

ShapeView-9.3.aar.zip

@getActivity
Copy link
Owner

小伙子,问题处理了,你再测试一下看看。

@MrHayden
Copy link
Author

轮子哥,这个新的aar解决了这个问题,感谢大佬。

@MrHayden
Copy link
Author

轮子哥,这里使用文字描边不主动写换行符\n固定了宽度也不会自动换行

@getActivity
Copy link
Owner

轮子哥,这里使用文字描边不主动写换行符\n固定了宽度也不会自动换行

目前针对这个问题,并无好的解决方案

@MrHayden
Copy link
Author

好的,那个居中的问题是看的可以了,你发个版本不

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