imageview 相关问题

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

ImageView 的 Android Talkback 问题

我使用 ImageView 来实现旁白可访问性,如下所示: imageView.setContentDescription("这是ImageView控件"); 但我面临的问题是,配音发音完整

回答 1 投票 0

在设置新位图之前如何在平移和缩放后将图像视图重置为原始/干净状态

我尝试过 Stackoverflow 系统提供的许多类似问题,但它们适用于其他场景。我不使用画布,我使用矩阵来缩放和平移,但与滚动结合......

回答 1 投票 0

Kotlin中改变scaleX和scaleY后如何获取图像在imageview中的位置

我需要在比例改变后获取ImageView内图像的位置、宽度和高度。我需要这些值来添加代码来控制滚动限制。 我见过其他线程使用

回答 1 投票 0

Android Studio:显示我的 Android 画廊中的图像

我是 Java 和 Android Studio 编程新手。我正在尝试创建一个简短的应用程序,感谢这里其他程序员的帖子:一个带有“从图库浏览”按钮的应用程序 -> 当我单击...

回答 1 投票 0

图像未加载到扩展 AppCompatImageView 的自定义视图类中

我设计了一个名为 PaintView 的自定义类。我的目标是加载用户选择的图像并允许用户像画笔一样绘画或在其上放置不同的形状。 这是我的实现方式...

回答 1 投票 0

如何避免 Android 应用程序中 Imageview 出现像素化?

我正在编写一个音乐播放器应用程序,想要显示每首歌曲的专辑封面。有些专辑封面看起来不错,而其他封面则像素化。这个问题似乎没有任何模式。 ...

回答 1 投票 0

ImageView/ImageButton 中的 srcCompat 和背景有什么不同

我在RelativeLayout中有一个ImageView。 ImageView 的背景是空的,srcCompat 链接到我的可绘制文件夹中的图像。在布局预览中,一切看起来都很好,但是......

回答 3 投票 0

如何将图像缩放到顶部中心? - 安卓

我有一个图像视图作为背景。它比屏幕大。我想将其水平居中。它应该与顶部对齐。因此,原始图像的顶部应该在屏幕上看到。我可以调整大小

回答 2 投票 0

如何在android imageview中显示数据库中的图像

嗨,在我的应用程序中,我得到了该图像中的 json 响应。我想在 android imageview 中显示该图像。在该图像中,我想为 imageView 设置。 图片":"

回答 1 投票 0

将图像添加到 JavaFX TableView 列中

我是 Java 和 OOP 新手,并且在向 tableview 列添加图像时陷入困境。代码似乎有效,我可以看到学生的姓名正确,但图像未显示在列中。我收到这个电子...

回答 1 投票 0

android 库 glide 不起作用。只有这种形式的网址

我想在我的应用程序中使用glide库设置这个url照片“http://file.koreafilm.or.kr/thm/02/00/01/66/tn_DPF002814.JPG”。 Glide.with(上下文)。 加载(movieImageArray.get(

回答 3 投票 0

如何将位图放入圆角正方形中?

我正在使用 Android Studio,我希望能够从图库中拾取图像,调整其大小并通过保持正确的宽高比使其适合圆角正方形(约 300x300px)...

回答 2 投票 0

如何在 Android 中将文本屏蔽到 Imageview 中?

我一直在尝试获得如下所需的结果,但没有成功。我需要将图像视图屏蔽为文本,以便图像视图看起来像文本,但仍然作为图像视图工作,以便我可以使用缩放

回答 2 投票 0

JavaFX SceneBuilder ImageView 不工作

我需要使用 SceneBuilder 创建一个 GUI。我在界面中添加了一个 ImageView 并正确设置了图像的路径。该图像显示在 SceneBuilder 中,但是当我运行我的应用程序时,我...

回答 7 投票 0

JavaFx ImageView 不会在绑定到 VBox 的 fitWidthProperty 上调整大小

我正在尝试重新调整图像大小,使其适合(缩放)在SplitPane分配的空间中(解决方法建议:该图像在运行程序时会发生变化,它应该从...

回答 3 投票 0

大小为 [0x0] 的 null 类 com.bumptech.glide.load.engine.GlideException 加载失败:收到空模型

我正在尝试加载我在 firebase 上保存的照片,它已保存成功,但无法再次加载图像,错误是 “大小为 [0x0] 的空值加载失败 com.bumptech.glide.load 类....

回答 3 投票 0

如何在单个 ImageView 中获得不同的点击位置

我正在开发一个应用程序,我需要在其中实现热点之类的东西。热点实际上是一个具有不同部分的图像,当用户单击该图像的不同部分时...

回答 2 投票 0

不是DRM文件,无法打开

我正在寻找有关因调用而导致的重复日志打印的解决方案 BitmapFactory.decodeFile。 在我的应用程序中,我有一个 ListView 每秒由计时器重绘。 列表Vi...

回答 2 投票 0

如何在 Android Studio 中让图像随不同屏幕尺寸缩放?

在我的代码中,我的应用程序运行良好,但当我使用不同的屏幕尺寸时,我遇到了问题。按钮排列正确,但图像根本不缩放。 这是我的 XML 文件 在我的代码中,我的应用程序运行良好,但当我使用不同的屏幕尺寸时,我遇到了问题。按钮排列正确,但图像根本无法缩放。 这是我的 XML 文件 <?xml version="1.0" encoding="utf-8"?> <ScrollView 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:layout_width="wrap_content" android:layout_height="wrap_content" tools:ignore="SpeakableTextPresentCheck"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#FFC107" android:padding="40dp" tools:context=".ActivitiesActivity"> <!-- ImageView Declarations --> <ImageView android:id="@+id/alabama_music_hall_of_fame" android:layout_width="match_parent" android:layout_height="150dp" android:contentDescription="@string/alabama_music_hall_of_fame_logo" app:layout_constraintTop_toTopOf="parent" app:layout_constraintEnd_toEndOf="@id/the_boiler_room" app:srcCompat="@drawable/activity_alabama_music_hall_of_fame_card" /> <Button android:id="@+id/alabama_music_hall_of_fame_FacebookButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/alabama_music_hall_of_fame" app:layout_constraintStart_toStartOf="@id/alabama_music_hall_of_fame" app:layout_constraintEnd_toStartOf="@id/alabama_music_hall_of_fame_InstagramButton" app:layout_constraintHorizontal_chainStyle="spread_inside" /> <Button android:id="@+id/alabama_music_hall_of_fame_InstagramButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/alabama_music_hall_of_fame" app:layout_constraintStart_toEndOf="@id/alabama_music_hall_of_fame_FacebookButton" app:layout_constraintEnd_toStartOf="@id/alabama_music_hall_of_fame_WebsiteButton" /> <Button android:id="@+id/alabama_music_hall_of_fame_WebsiteButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/alabama_music_hall_of_fame" app:layout_constraintStart_toEndOf="@id/alabama_music_hall_of_fame_InstagramButton" app:layout_constraintEnd_toStartOf="@id/alabama_music_hall_of_fame_DirectionsButton" /> <Button android:id="@+id/alabama_music_hall_of_fame_DirectionsButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/alabama_music_hall_of_fame" app:layout_constraintStart_toEndOf="@id/alabama_music_hall_of_fame_WebsiteButton" app:layout_constraintEnd_toEndOf="@id/alabama_music_hall_of_fame" /> <!-- The Boiler Room ImageView --> <ImageView android:id="@+id/the_boiler_room" android:layout_width="0dp" android:layout_height="150dp" android:layout_marginTop="10dp" android:contentDescription="@string/the_boiler_room_logo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/alabama_music_hall_of_fame" app:srcCompat="@drawable/activity_the_boiler_room" /> <!-- Buttons under The Boiler Room ImageView --> <Button android:id="@+id/the_boiler_room_FacebookButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_boiler_room" app:layout_constraintEnd_toStartOf="@id/the_boiler_room_InstagramButton" app:layout_constraintStart_toStartOf="@id/the_boiler_room" app:layout_constraintHorizontal_chainStyle="spread" /> <Button android:id="@+id/the_boiler_room_InstagramButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_boiler_room" app:layout_constraintEnd_toStartOf="@id/the_boiler_room_WebsiteButton" app:layout_constraintStart_toEndOf="@id/the_boiler_room_FacebookButton" /> <Button android:id="@+id/the_boiler_room_WebsiteButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_boiler_room" app:layout_constraintEnd_toStartOf="@id/the_boiler_room_DirectionsButton" app:layout_constraintStart_toEndOf="@id/the_boiler_room_InstagramButton" /> <Button android:id="@+id/the_boiler_room_DirectionsButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_boiler_room" app:layout_constraintEnd_toEndOf="@id/the_boiler_room" app:layout_constraintStart_toEndOf="@id/the_boiler_room_WebsiteButton" /> <!-- The Escape Room ImageView --> <ImageView android:id="@+id/the_escape_room" android:layout_width="0dp" android:layout_height="150dp" android:layout_marginTop="10dp" android:contentDescription="@string/the_escape_room_logo" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/the_boiler_room" app:srcCompat="@drawable/activity_the_escape_room" /> <!-- Buttons under The Escape Room ImageView --> <Button android:id="@+id/the_escape_room_FacebookButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_escape_room" app:layout_constraintEnd_toStartOf="@id/the_escape_room_InstagramButton" app:layout_constraintStart_toStartOf="@id/the_escape_room" app:layout_constraintHorizontal_chainStyle="spread" /> <Button android:id="@+id/the_escape_room_InstagramButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_escape_room" app:layout_constraintEnd_toStartOf="@id/the_escape_room_WebsiteButton" app:layout_constraintStart_toEndOf="@id/the_escape_room_FacebookButton" /> <Button android:id="@+id/the_escape_room_WebsiteButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_escape_room" app:layout_constraintEnd_toStartOf="@id/the_escape_room_DirectionsButton" app:layout_constraintStart_toEndOf="@id/the_escape_room_InstagramButton" /> <Button android:id="@+id/the_escape_room_DirectionsButton" android:layout_width="0dp" android:layout_height="33dp" android:background="@android:color/transparent" app:layout_constraintBottom_toBottomOf="@id/the_escape_room" app:layout_constraintEnd_toEndOf="@id/the_escape_room" app:layout_constraintStart_toEndOf="@id/the_escape_room_WebsiteButton" /> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView> 我尝试过在图像视图中设置不同的约束,我已经累了 android:layout_width="wrap_content" android:layout_height="150dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_height="150dp" 几乎我尝试过的任何不同配置,我觉得我缺少一些基本的东西。 我已经弄清楚了,我在 ScrollView 内部使用了 CardView,无论屏幕尺寸如何,图像都保持相同。我还为我的按钮使用了 LinerLayout,这样它们就会保留在图像的底部! `<?xml version="1.0" encoding="utf-8"?> <ScrollView 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:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" tools:ignore="SpeakableTextPresentCheck"> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FFC107" android:padding="40dp" tools:context=".ActivitiesActivity"> <androidx.cardview.widget.CardView android:id="@+id/alabama_music_hall_of_fame_card" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="8dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" app:cardCornerRadius="0dp" app:cardElevation="4dp"> <ImageView android:id="@+id/alabama_music_hall_of_fame" android:layout_width="match_parent" android:layout_height="200dp" android:src="@drawable/activity_alabama_music_hall_of_fame_card" android:scaleType="fitXY" android:contentDescription="@string/alabama_music_hall_of_fame_logo"/> <LinearLayout style="?android:attr/buttonBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="bottom" android:gravity="center_horizontal"> <Button android:id="@+id/alabama_music_hall_of_fame_FacebookButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/amhfFB" android:background="@android:color/transparent" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/alabama_music_hall_of_fame_InstagramButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/amhfIG" android:background="@android:color/transparent" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/alabama_music_hall_of_fame_WebsiteButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/amhfWeb" android:background="@android:color/transparent" /> <Button android:id="@+id/alabama_music_hall_of_fame_DirectionsButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/amhfDir" android:background="@android:color/transparent" tools:ignore="VisualLintButtonSize" /> </LinearLayout> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:id="@+id/the_boiler_room_card" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="16dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/alabama_music_hall_of_fame_card" app:cardCornerRadius="0dp" app:cardElevation="4dp"> <ImageView android:id="@+id/the_boiler_room" android:layout_width="match_parent" android:layout_height="150dp" android:contentDescription="@string/the_boiler_room_logo" android:src="@drawable/activity_the_boiler_room" android:scaleType="fitXY"/> <LinearLayout style="?android:attr/buttonBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="bottom" android:gravity="center_horizontal"> <Button android:id="@+id/the_boiler_room_FacebookButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/tbrFB" android:background="@android:color/transparent" /> <Button android:id="@+id/the_boiler_room_InstagramButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/tbrIG" android:background="@android:color/transparent" /> <Button android:id="@+id/the_boiler_room_WebsiteButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/tbrWeb" android:background="@android:color/transparent" /> <Button android:id="@+id/the_boiler_room_DirectionsButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/tbrDir" android:background="@android:color/transparent"/> </LinearLayout> </androidx.cardview.widget.CardView> <androidx.cardview.widget.CardView android:id="@+id/the_escape_room_card" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="16dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toBottomOf="@id/the_boiler_room_card" app:cardCornerRadius="0dp" app:cardElevation="4dp"> <ImageView android:id="@+id/activity_the_escape_room" android:layout_width="match_parent" android:layout_height="200dp" android:contentDescription="@string/the_escape_room_logo" android:src="@drawable/activity_the_escape_room" android:scaleType="fitXY"/> <LinearLayout style="?android:attr/buttonBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_gravity="bottom" android:gravity="center_horizontal"> <Button android:id="@+id/the_escape_room_FacebookButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/terFB" android:background="@android:color/transparent" tools:ignore="VisualLintButtonSize" /> <Button android:id="@+id/the_escape_room_InstagramButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/terIG" android:background="@android:color/transparent" /> <Button android:id="@+id/the_escape_room_WebsiteButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/terWeb" android:background="@android:color/transparent" /> <Button android:id="@+id/the_escape_room_DirectionsButton" style="?android:attr/buttonBarButtonStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/terDir" android:background="@android:color/transparent"/> </LinearLayout> </androidx.cardview.widget.CardView> </androidx.constraintlayout.widget.ConstraintLayout> </ScrollView>`

回答 1 投票 0

毕加索以横向模式显示图像

使用Picasso库从服务器下载图像并将其放置在ImageView中,但每次它仅以横向模式显示图像,甚至最初以纵向模式显示图像。 我有一些我...

回答 3 投票 0

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