微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 iOS 中的 Xamarin 按钮上将图像左对齐并将文本对齐到中心?

如何解决如何在 iOS 中的 Xamarin 按钮上将图像左对齐并将文本对齐到中心?

我想将文本居中对齐,但图像在左侧。我已经尝试过使用 Horizo​​ntalAlignment,但它同时对齐了两者。怎么做?

解决方法

尝试使用 ButtonContentLayout.ImagePosition 属性:

https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.button.buttoncontentlayout.imageposition?view=xamarin-forms

,

你知道我如何从 ButtonRenderer 中的 Control 设置它吗?

您可以更改渲染器中按钮的 try: guild = ctx.guild if not guild.has_role(name="Muted"): await guild.create_role(name="Muted") except Exception as e: print(e) await ctx.send("something went wrong") ImageEdgeInsets 以更改图像和标题位置:

TitleEdgeInsets

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。