imageview

Android drag and drop issue not displaying

眉间皱痕 提交于 2019-12-07 15:20:06
问题 I'm working on a drag and drop application, everything is working fine but I saw an issue. I have 3 ImageViews, two of them are draggable objects and the other one is the drop target. Every time I drop the object in any location other than the drop target, it's totally disappearing! Below is the code I used: ImageView iv1, iv2, iv3; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); initControls(); }

Android how to get bounds of imageview with matrix

房东的猫 提交于 2019-12-07 13:58:02
问题 I have an ImageView with scaletype set to matrix, and would like to get a Rect with the bounds of the image after the transformation of the matrix. How do I get such a rect? thanks. 回答1: ImageView imageView = (ImageView)findViewById(R.id.imageview); Drawable drawable = imageView.getDrawable(); Rect imageBounds = drawable.getBounds(); Then use Matrix.mapRect. 来源: https://stackoverflow.com/questions/8590693/android-how-to-get-bounds-of-imageview-with-matrix

UIImageView.image bigger than UIImageView

人走茶凉 提交于 2019-12-07 13:58:01
问题 I have a UIImageView in a custom tableview cell. When I set the UIimageview property, the uiimageview.image is bigger than the uiimageview. Why? Here is the code: cell.imageView.image=[UIImage imageNamed:@"BlueMooseLogo.png"]; And here is a link to what the cell looks like. The blue square is the background of the imageview, and the blue moose is the image. https://docs.google.com/document/d/1G7BYCriYbSGYHryP5OI7XHuVpqRKiNcBrxdY14wDgoA/edit?usp=sharing If it's relevant, within interface

How to open an image in drawable folder using android imageview applications?

萝らか妹 提交于 2019-12-07 13:02:49
问题 I want to open an image in my drawable folder via default imageview applications of my phone (Gallery, etc.). My image location: drawable/image.png Code: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(""), "image/*"); startActivity(intent); What do I need to write in Uri.parse function to see the image file? 回答1: To do that you have to copy your image in drawable folder to SD card and then give the path of the file in SD card to intent.

Add view to constraintLayout with constraints similar to another child

亡梦爱人 提交于 2019-12-07 11:17:34
问题 I have a constraint layout (alpha9) with views spread all over it, and I have one particular ImageView that I need to replicate and add more of like it. The layout is like so : The main purpose is to animate 5 of those "coin" imageViews when the button is pressed. The imageViews i need to generated sha'll have exact properties of the the imageView behind the Button down below (with same constraints) What i tried to do is the following : private ImageView generateCoin() { ImageView coin = new

Android - Save ImageView to file with full resolution image

限于喜欢 提交于 2019-12-07 11:02:39
问题 I put an image inside an ImageView and have multitouch implemented to resize and move the image inside the ImageView. Now I need to save the resized image to a image file. I have tried the .getDrawingCache() but that image have the size of the ImageView. I want the image to show what the ImageView shows but with full resolution (larger than the ImageView). Any ideas? 回答1: You could hold a Bitmap Object in Background, which you can resize with this piece of code: Matrix matrix = new Matrix();

Image not appearing on HTC One M8

淺唱寂寞╮ 提交于 2019-12-07 10:54:29
问题 I'm currently developing a new app for the company I'm working at. We test this on multiple devices, now a strange thing I noticed the other day, well someone else did. My Colleague tested the app on his HTC one m8, and we have a background image on the login page but it didn't show for him. It did however on a Nexus 7, Samsung Galaxy Tab 4, Motorola G and Samsung S4. This might be very specific, but I guess some people must have noticed this kind of behaviour before on certain devices and

Changing image view background dynamically

梦想的初衷 提交于 2019-12-07 10:29:34
问题 I have a a set of 10 imageviews in my layout. I have given them sequential id's also as android:id="@+id/pb1" android:id="@+id/pb2" Now I want to change background dynamically. int totalPoi = listOfPOI.size(); int currentPoi = (j/totalPoi)*10; for (i=1;i<=currentPoi;i++) { imageview.setBackgroundResource(R.drawable.progressgreen); } Now inside the for loop I want to set the image view background dynamically. i,e if the currentpoi value is 3, background of 3 image views should be changed. What

How can I create multiple context menus?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 10:08:47
问题 I have 1 activity, but would like to have multiple context menu's for different UI components. For example, I have a ListView which will react to: @Override public void onCreateContextMenu(ContextMenu menu, View v,ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); menu.setHeaderTitle("Selection Options"); menu.add(0, v.getId(), 0, "Remove"); } How can I create another context menu for the onClick event for an ImageView I have? 回答1: Actually, this method is to change the

How do I add an image in the drawable folder to an ImageView in Android Studio 1.2?

╄→гoц情女王★ 提交于 2019-12-07 08:35:39
问题 Since Google added the mipmap folder for the launcher icons, I have had issues using the drawables folder. I manually added the hdpi folders in the drawable folder, but when I try and add the src path, the images won't allow me to view and select them. How do I add an image in the drawable folder to an ImageView in Android Studio 1.2? 回答1: try with this way of code there are three ways to set image on ImageView imageView.setImageResource(R.drawable.play); or <ImageView android:id="@+id