使用无线电按钮而不是仅在Android中显示目的是好的吗?

发布于 2025-01-28 09:56:16 字数 264 浏览 2 评论 0原文

我有一个设计,图像视图看起来像一个单选按钮,但没有收到无线电检查/未选中的目的。由于它看起来像一个单选按钮,因此使用启用状态并关闭用户互动的广播按钮是否很好,而不是在项目中添加图像的图像视图?

哪种方法更好?该系统在拥有imageview或播放按钮而不是另一个系统时有什么额外的裁判?

设计的屏幕截图

I have a design where the image view looks like a radio button but serves no purpose of radio checked/ unchecked. Since it looks like a radio button, is it good to use a radio button which state enabled and user interaction off, instead of having an image view with image added in the project?

Which is the better approach? What extra burder does the system have in having imageview or radio button instead of the other one?

screenshot of the design

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

裸钻 2025-02-04 09:56:16

您可以在textview xml 中添加可绘制

app:drawableStartCompat="@drawable/icon"

绘制

的 您可以使用简单的查看并用textView来约束它。

      <View
        android:id="@+id/view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/ring"
        app:layout_constraintBottom_toBottomOf=""
        app:layout_constraintEnd_toStartOf=""
        app:layout_constraintStart_toStartOf=""
        app:layout_constraintTop_toTopOf="" />

You can add drawable to your TextView in xml as

app:drawableStartCompat="@drawable/icon"

So, there is no need of using ImageView or RadioButton

Or you can use simple View and constraint it with your textView

      <View
        android:id="@+id/view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/ring"
        app:layout_constraintBottom_toBottomOf=""
        app:layout_constraintEnd_toStartOf=""
        app:layout_constraintStart_toStartOf=""
        app:layout_constraintTop_toTopOf="" />
岁月静好 2025-02-04 09:56:16

就系统而言,没有负担。但是,负担负担在开发商和项目的维护者身上。将图像视图放置在无线电按钮的实际功能中,无缘无故地使事情变得复杂。
如果意图是显示选项/选择,则广播按钮是显而易见的选择。它对用户也很直观,当然也可以直接使用代码。

As far as the system goes, there is no burden. The burden is however on the developer and the maintainer of the project. Putting an imageview where actually the functionality is for a radio button complicates matters for no reason.
If the intent is to show options/choices, then radio button is the obvious choice. It's intuitive to the user as well and of course straight forward to code.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文