imageview 相关问题

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

使用picasso制作带圆角的ImageView

我知道有很多链接可用于制作 ImageView 圆角。 但我正在使用毕加索库进行图像加载.. 我参考链接来获取结果。 但问题是我在 Lis 中使用它......

回答 8 投票 0

Android Studio:如何同时影响多个视图? (XML + Kotlin)

我试图做到这一点,以便当我将鼠标悬停在 30 个左右的 ImageView 之一上时,它们后面会出现灰色背景。不幸的是,除了调用每个 ImageView 之外,我不知道如何做到这一点

回答 2 投票 0

在ConstraintLayout中有一个具有相同宽度和高度的ImageView

如何让ImageView的宽度和高度等于父ConstraintLayout的宽度?所以它显示一个全宽的方形ImageView。 一般来说,如何将某个小部件的高度设置为等于

回答 2 投票 0

如何在 GridView Android Studio 中完美适配图像

我正在尝试创建一个使用 GridView 来显示图像的项目。但问题是图像可以有各种尺寸。有些很大,有些很小。所以我想将图像放入

回答 1 投票 0

使用 BaseAdapter 和 ImageView Helper 下载图像时滚动缓慢

在我的应用程序中,我使用 UrlImageViewHelper 库。在运行时,应用程序将从服务器获取一个 xml 文件以及超过 300 个相关图像。我面临与滚动速度相关的问题。 ...

回答 1 投票 0

Recyclerview 不显示从设备媒体存储获取的图像 - Android

我试图在从设备库读取后在recyclerview中显示所有图像,但recyclerview没有显示任何图像。 主要活动: 类 MainActivity : AppCompatActivity() { 私人

回答 1 投票 0

调整ViewBounds对于图像输出到底做了什么?

我有这个代码: 我有这个代码: <ImageView android:id="@+id/imageView3" android:layout_gravity="center" android:gravity="center" android:layout_width="300dp" android:layout_height="300dp" android:src="@drawable/house1" android:scaleType="fitXY" /> 我有这个代码: <ImageView android:id="@+id/imageView3" android:layout_gravity="center" android:gravity="center" android:layout_width="300dp" android:layout_height="300dp" android:src="@drawable/house1" android:scaleType="fitXY" android:adjustViewBounds="true"/> 但我没有看到图像输出有任何变化。 调整ViewBounds对于图像输出到底做了什么? 使用adjustViewBounds时,您需要将ImageView的宽度或高度设置为wrap_content,另一个设置为固定值。然后,当您将 adjustViewBounds 设置为 true 时,Android 会根据您设置的固定高度或宽度值调整图像并保持宽高比。 scaleType 也发挥着作用。

回答 1 投票 0

如何在java中获取图像名称?

我想在android中获取图像名称 例如, ImageView img = (ImageView)findViewByID(R.id.MyImage); img.srcName() // 它应该返回以下 android:src="@drawable/abc" 有可能吗...

回答 3 投票 0

如何在android中使图像适合圆形框架

我有一个ListView,其中有一个ImageView,ImageView中的图像在从服务器获取后动态加载。 现在,我想要这些任意大小的图像适合圆形......

回答 8 投票 0

将图像添加到编辑文本视图

如何将图像添加到 Android Studio 中的编辑视图中,类似于以下内容: 在此输入图像描述 图像视图显示在编辑文本视图中的位置 我想过嵌套视图,但是...

回答 1 投票 0

在移动和缩放时绘制到ImageView

如果 ImageView 是 fitXY 而不是矩阵,则每个绘制的像素都是正确的。 但我需要一个矩阵视图,您可以在其中缩放和移动图片,并在其顶部标记图片上的内容,同时...

回答 1 投票 0

Beeware 有什么方法可以在 Android 手机上显示图片吗?

我构建了一个 Beeware 应用程序,并且希望找到一种方法在我的 Android 手机上从手机存储中显示 .png 图片。据我所知,Beeware 中的 Toga GUI 既不支持 ImageView...

回答 1 投票 0

Android ImageView 被裁剪

首先这是一张图来说明我的问题: 形象的 在左图中,您可以看到它的外观。这也是 AndroidStudio 在预览中的展示方式。但如果我在

回答 2 投票 0

Fresco java.lang.UnsatisfiedLinkError:dlopen 失败:找不到库“libnative-imagetranscoder.so” - Android Studio - Java

添加这个并没有解决我的问题 实现(“com.facebook.fresco:nativeimagetranscoder:3.0.0”) 但这解决了我在 gradle 依赖项中使用 Android Studio 和 Java 的问题

回答 1 投票 0

图像被裁剪且有圆角

我正在尝试将图像加载到图像视图中: 但图像在图像视图中被裁剪: 我正在尝试将图像加载到图像视图中: 但图像在图像视图内被裁剪: <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:layout_marginBottom="10dp" android:gravity="center" android:scaleType="centerCrop" android:src="@mipmap/icona_animal_app" /> 为什么会发生这种事?我该如何解决? 我已经尝试过属性“scaleType”的所有值,例如“fitcenter”,但没有任何效果 活动代码: 我正在尝试将图像加载到图像视图中:在此处输入图像描述 但图像在图像视图内被裁剪: public class Login extends AppCompatActivity { //dichiarazione oggetti TextInputEditText editTextEmail, editTextPassword; Button buttonLogin; Button buttonLogRapido; FirebaseAuth mAuth; ProgressBar progressBar; TextView TextView; @Override public void onStart() { super.onStart(); // Check if user is signed in (non-null) and update UI accordingly. FirebaseUser currentUser = mAuth.getCurrentUser(); if(currentUser != null){ //se l'utente è attualmente connesso vado alla main activity Intent intent = new Intent(getApplicationContext(), MainActivity.class); startActivity(intent); finish(); } } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); //inizializzazione oggetti mAuth = FirebaseAuth.getInstance(); editTextEmail = findViewById(R.id.email); editTextPassword = findViewById(R.id.password); buttonLogin = findViewById(R.id.btn_login); buttonLogRapido = findViewById(R.id.btn_accesso); progressBar = findViewById(R.id.progressBar); TextView = findViewById(R.id.registerNow); // vai alla schermata di selezione tipo utente da ragistrare TextView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getApplicationContext(), RegistrazioneMain.class); startActivity(intent); //finish(); } }); // vai alla selezione utente con login automatico buttonLogRapido.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(getApplicationContext(), AccessoRapido.class); startActivity(intent); finish(); } }) ; // effettua login da input buttonLogin.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { progressBar.setVisibility(View.VISIBLE); String email, password; email = String.valueOf(editTextEmail.getText()); password = String.valueOf(editTextPassword.getText()); //controllo campi a video if (TextUtils.isEmpty(email)){ Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.insEmail), Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(password)){ Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.insPassword), Toast.LENGTH_SHORT).show(); return; } mAuth.signInWithEmailAndPassword(email, password) .addOnCompleteListener(new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { // Sign in success, update UI with the signed-in user's information FirebaseUser user = mAuth.getCurrentUser(); DatabaseReference db = FirebaseDatabase.getInstance().getReference("/Utenti"); ChatHelper.getIstance().notifyUnreadMessages(getApplicationContext()); db.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { if (snapshot.child("Padrone").child(user.getUid()).exists()) { Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autEseguita), Toast.LENGTH_SHORT).show(); //se eseguito vado alla main activity Intent intent = new Intent(getApplicationContext(), HomePadrone.class); startActivity(intent); finish(); } if (snapshot.child("Veterinario").child(user.getUid()).exists()) { Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autEseguita), Toast.LENGTH_SHORT).show(); //se eseguito vado alla main activity Intent intent = new Intent(getApplicationContext(), HomeVeterinario.class); startActivity(intent); finish(); } if (snapshot.child("Attivita").child(user.getUid()).exists()) { Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autEseguita), Toast.LENGTH_SHORT).show(); //se eseguito vado alla main activity Intent intent = new Intent(getApplicationContext(), HomeAttivita.class); startActivity(intent); finish(); } if (snapshot.child("Segnalatore").child(user.getUid()).exists()) { Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autEseguita), Toast.LENGTH_SHORT).show(); //se eseguito vado alla main activity Intent intent = new Intent(getApplicationContext(), HomeSegnalatore.class); startActivity(intent); finish(); } if (snapshot.child("Ente").child(user.getUid()).exists()) { Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autEseguita), Toast.LENGTH_SHORT).show(); //se eseguito vado alla main activity Intent intent = new Intent(getApplicationContext(), HomeEnte.class); startActivity(intent); finish(); } } @Override public void onCancelled(@NonNull DatabaseError error) { } }); } else { // If sign in fails, display a message to the user. Toast.makeText(Login.this, getApplicationContext().getResources().getString(R.string.autFallita), Toast.LENGTH_SHORT).show(); } progressBar.setVisibility(View.GONE); } }); } }); } } 为什么会发生这种事?我该如何解决? 我已经尝试过属性“scaleType”的所有值,例如“fitcenter”,但没有任何效果 布局文件代码: <LinearLayout 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:gravity="center" android:orientation="vertical" android:padding="15dp" tools:context=".Autenticazione.Login"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:layout_marginBottom="10dp" android:gravity="center" android:scaleType="centerCrop" android:src="@mipmap/icona_animal_app" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="30dp" android:fontFamily="sans-serif-light" android:gravity="center" android:text="@string/animalApp" android:textColor="#FF9800" android:textSize="30sp" android:textStyle="bold" /> <com.google.android.material.textfield.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/email" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/email" /> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <com.google.android.material.textfield.TextInputEditText android:id="@+id/password" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/password" /> </com.google.android.material.textfield.TextInputLayout> <ProgressBar android:id="@+id/progressBar" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" /> <Button android:id="@+id/btn_login" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="25dp" android:gravity="center" android:text="@string/Accedi" /> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="15dp" android:gravity="center" android:text="@string/Non_hai_un_account" android:textSize="15dp" /> <TextView android:id="@+id/registerNow" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="45dp" android:gravity="center" android:text="@string/Registrati_ora" android:textSize="15dp" android:textStyle="bold" /> <Button android:id="@+id/btn_accesso" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="25dp" android:gravity="center" android:text="@string/accesso_rapido" /> </LinearLayout> 您是否尝试过使用 android:scaleType="fitXY" 例如见下文: <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:scaleType="fitXY" android:layout_marginBottom="10dp" android:gravity="center" android:scaleType="centerCrop" android:src="@mipmap/icona_animal_app" />

回答 1 投票 0

如何在ImageView上定义一些可点击的区域(如HTML图像地图)

假设我有一个显示学校地图的 ImageView: 我想在图像上定义一些可点击区域(例如 HTML 图像映射),如下所示: 点 musicRoom = new Point(30,70); 点

回答 1 投票 0

图像在图像视图中被裁剪

我正在尝试将图像加载到图像视图中: 但图像在图像视图中被裁剪: 我正在尝试将图像加载到图像视图中: 但图像在图像视图内被裁剪: <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="30dp" android:layout_marginBottom="10dp" android:gravity="center" android:scaleType="centerCrop" android:src="@mipmap/icona_animal_app" /> 为什么会发生这种事?我该如何解决? 尝试将 android:scaleType="centerCrop" 更改为 android:scaleType="fitCenter"

回答 1 投票 0

如何在运行时检查图像视图来自本地还是远程资源?

如果我在 Android 应用程序中作为第三方库运行,并且我想检查屏幕上的图像视图是从本地捆绑资源加载还是从远程用户加载...

回答 1 投票 0

如何在ZoomageView上设置onClick监听器

我正在 kotlin 中为 android 制作图库应用程序。我正在使用 ZoomageView 全屏显示图像。我还想在 imag c 的单击上显示菜单和底部以进行共享、添加/删除收藏夹等...

回答 1 投票 0

ImageView - 实现与 ViewPager 兼容的手势(捏缩放、双击)(就像 Android Gallery)

我一直在寻找一种有效的方法来使用 ViewPager 实现 ImageView 的手势。 我尝试了一些示例,但它们效果不佳(例如,捏缩放实际上没有缩放到我想要的位置......

回答 1 投票 0

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.