imageview 相关问题

显示任意图像或可绘制图形的Android小部件,例如图标。

使用 Coil 在宽度上缩放图像并在高度上裁剪图像

我有一个具有固定高度(400dp)和可变宽度(匹配父级)的ImageView。我正在使用 Coil 从网络加载内容。 我有一些风景图像和其他肖像图像。 我是...

回答 1 投票 0

Android应用程序的后台问题

我正在使用 Android Studio 实现一个应用程序,并且我创建了一个 Activity 来选择背景。如果我使用我已经意识到的导航按钮,一切都会正常,但如果我按...

回答 1 投票 0

如何获取屏幕尺寸

所以我有一个在 LinearLayout 中定义 ImageView 的应用程序。 ImageView 和 LinearLayout 的宽度和高度被指定为“match_parent”,并且 ImageView 确实看起来是......

回答 1 投票 0

Fresco - 如何检查文件是否是 webP 动画?

我有一个webP格式的图像文件。如何以编程方式检查它是动画 webP 还是静态图像?

回答 2 投票 0

检测对 imageView 中特定 x 和 y 坐标的点击

我的桌面上有一个图像,我已使用“画图”应用程序打开该图像并获取带有 x 和 y 像素的特定位置,例如:374,207 px 但是当我将图像添加到我的 Android 应用程序并使用时...

回答 1 投票 0

Android ImageButton 和 TextView 在 Framelayout 中的索引位置

我有一排 3 个 ImageButtons 包裹在 LinearLayout 中。 然后将每个ImageButton封装在一个FrameLayout中: 我有一排 3 个 ImageButtons 包裹在 LinearLayout 中。 然后将每个ImageButton封装在一个FrameLayout中: <FrameLayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight="1"> <ImageButton android:layout_width="wrap_content" android:layout_margin="5dp" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="centerInside" android:src="@drawable/btn1" android:background="@null" android:foreground="?android:attr/selectableItemBackground" /> <TextView android:layout_width="35dp" android:layout_height="35dp" android:text="1" android:textSize="12sp" android:textColor="#ffffff" android:padding="10dp" android:layout_gravity="top|right" android:background="@drawable/smallcircle"/> </FrameLayout> 在每个 ImageView 上,我希望在右上角有一个带有圆形背景的小数字。这工作得很好,但我无法将文本置于圆圈中心。 如果我有文字,例如15,看起来是居中的,但是当数字只有1的时候,它并不在中心。 我无法在 TextView 中使用中心,因为已经有一个布局重力将带有圆圈的数字移动到右上角。 圆圈背景: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <size android:width="35dp" android:height="35dp" /> <solid android:color="#4CAF50" /> </shape> 示例: 嗯,Android Studio 根本没有在 TextView 中自动建议我 android:gravity,但是当我手动添加它时,它就完成了。因此 android:layout_gravity 移动到正确位置,android:gravity 使文本居中。 简单:)

回答 1 投票 0

如何像 Instagram 一样点击缩放图像?科特林

我正在尝试获得与 Instagram 类似的功能,当您点击或 捏住图像,现在图像覆盖了屏幕上方的所有图像 其他观点,例如 这 我有一个包含 3 个图像的片段...

回答 1 投票 0

如何在不插入低分辨率文件的情况下显示像素化的 ImageView?

我想加载一个带有低分辨率png文件的ImageView。我想显示像素,但 ImageView 通过插值将其显示得模糊。如何避免这种情况?我想展示...

回答 1 投票 0

JavaFX。单击按钮中的线程

单击 myButton 后,运行 2 个线程。首先更改按钮图像,第二个 - 循环。我希望我的程序首先更改图像并在运行循环之后。但这不行,他们一瞬间就完蛋了。 我的...

回答 1 投票 0

如何在 android studio 中解决这个问题?我是新人,正在向udemy学习

错误:/Users/guibrilramde/MyFirstUdemy/app/src/main/res/layout/activity_main.xml:19:AAPT:错误:'@tools:sample/avatars'与属性src(attr)引用不兼容|颜色。 错误:/Users/guibrilramde/MyFirstUdemy/app/src/main/res/layout/activity_main.xml:19:AAPT:错误:“@tools:sample/avatars”与属性 src(attr)参考|颜色不兼容。 <ImageView android:id="@+id/imageExample" android:layout_width="300dp" android:layout_height="300dp" android:scaleType="fitCenter" android:src="@tools:sample/avatars" tools:srcCompat="@drawable/ab" /> 你的两条线android:src="@tools:sample/avatars"和tools:srcCompat="@drawable/ab"都决定显示哪张图片,是矛盾的。删除两者并改为写 android:src="@drawable/ab"。 ab.png 图像当然必须位于 res/drawable 文件夹中。

回答 1 投票 0

在 ImageView 中错误显示 Base64 图像

我正在开发一个 Android 项目,我需要从 API 检索 Base64 编码的图像并将其显示在 ImageView 中。但是,我遇到了图像不显示的问题

回答 1 投票 0

base64 字符串在 kotlin 中并未完全实现

我正在开发一个 Android 项目,我需要从 API 检索 Base64 编码的图像并将其显示在 ImageView 中。但是,我遇到了图像不显示的问题

回答 1 投票 0

NavDrawer 的 imageview 中的图像配置文件

我从 Parse 获取一个图像文件,基本上是用户的个人资料图像。 但现在我无法在 NavDrawer 中显示它,原因是它不是图像视图,而我得到的是图像......

回答 4 投票 0

Android:如何将整个ImageView转换为Bitmap?

我的应用程序正在显示不同比例的图像,并在(centerInside)imageView内调整大小。我需要的是从 ImageView 创建位图,包括背景(黑色......

回答 8 投票 0

为什么我的ImageView不显示图像?

尝试使用 ImageView 显示图像,但未显示。 源图像保存在drawable目录中。 尝试使用 ImageView 显示图像,但未显示。 源图像保存在drawable目录中。 <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/constrainLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="centerInside" android:visibility="visible" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.485" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" tools:ignore="ContentDescription" tools:srcCompat="@drawable/nature"/> </androidx.constraintlayout.widget.ConstraintLayout> tools:srcCompat="@drawable/nature"用于在设计时显示图像。当您需要在运行时查看它时,您应该在您的 android:src="@drawable/nature" 中添加 ImageView: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/constrainLayout" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaleType="centerInside" android:visibility="visible" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.485" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" android:src="@drawable/nature" tools:ignore="ContentDescription" tools:srcCompat="@drawable/nature"/> </androidx.constraintlayout.widget.ConstraintLayout> 而不是使用 tools:srcCompat="@drawable/nature" 使用 android:src="@drawable/nature" 更换即可 tools:srcCompat="@drawable/nature" 由 android:src="@drawable/nature" 仅开发时间属性 -> tools: 生产级别(运行时)属性 -> android: 和 app: 运行时工具属性将被删除。所以你必须用 android:src 替换该属性。 tools:srcCompat="@drawable/nature" -> android:src="@drawable/nature"

回答 4 投票 0

(初学者)如何通过主 url 地址和惰性列表从网站加载图像?

我正在尝试找到一种方法将网站主页(使用图像滑块)的所有图像加载到图像视图/列表视图中(很像该死的应用程序)。在我的最后一个问题上,我问了一个类似的问题...

回答 2 投票 0

向上或向下滑动时,Viewpager 的 ImageViewer 过渡不平滑

我有一个过渡效果,可以从一张图像滑动到下一张图像,再滑动到上一张图像。滑动的图像被移动到屏幕之外,上一个/下一个图像从相反的屏幕进入......

回答 1 投票 0

动画 Alpha ImageView 淡入淡出

在视图模型的observe方法中,一个新的Observer正在监听正常工作的API响应。然而,根据响应,它正在调用以下方法来显示成功......

回答 1 投票 0

RecyclerView.Adapter 内的 Android Kotlin ImageView 未按预期更新

最终在我的服务器中实现设备类型的图标后,我用服务器中的图标替换了之前使用的临时可绘制对象,并使用线圈加载它们。他们的 ImageView 是

回答 1 投票 0

imageview中的图像模糊(Android java)

虽然我放入活动中的图像视图在设计屏幕上显示清晰,但在模拟器和真实手机上显示清晰。我怎样才能解决这个问题?图像位于“drawable/xxhdpi”中

回答 1 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.