布局中 ImageView 的 ANTI_ALIAS_FLAG?

发布于 2024-10-28 00:41:58 字数 81 浏览 5 评论 0原文

有谁知道如何在布局中而不是在Java中将ANTI_ALIAS_FLAG应用到ImageView

Does anyone know how to apply the ANTI_ALIAS_FLAG to ImageView's in layouts rather than in Java?

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

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

发布评论

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

评论(2

蓝眼泪 2024-11-04 00:41:58

您想要应用属性 android:antialias="true",如下所示:

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:antialias="true" />

You want to apply the attribute android:antialias="true", like so:

<ImageView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/icon"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:antialias="true" />
薄荷港 2024-11-04 00:41:58

2013年方式:声明描述ImageView内容的特殊xml资源。例如,我们希望 ImageView 包含抗锯齿位图。所以我们需要写这样的东西:

<bitmap 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:antialias="true"
    android:src="@drawable/ic_draggable_item"/>

2013-year-way: declare special xml resource describing ImageView's content. For example we want an ImageView to contain antialiased Bitmap. So we need to write somethig like this:

<bitmap 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:antialias="true"
    android:src="@drawable/ic_draggable_item"/>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文