imageview

android:load svg file from web and show it on image view

孤者浪人 提交于 2019-11-26 10:35:41
问题 I want to load a svg file from the web and show this file in an ImageView. For non vector images I use the Picasso library. Is it possible to use this library for svg files as well? Is there any way to load svg files from the web and show it in an ImageView? I use the svg-android library to show svg files but i don\'t know how to get svg images from the web all the examples for this library use local files. 回答1: Please refer to Having issue on Real Device using vector image in android. SVG

android: create circular image with picasso

丶灬走出姿态 提交于 2019-11-26 10:18:37
问题 The question had been asked and there had been a promise made for the very version of Picasso that I am using: How do I send a circular bitmap to an ImageView using Picasso? I am new to Picasso and only thing I have used is Picasso.with(context).load(url).resize(w, h).into(imageview); I have already found https://gist.github.com/julianshen/5829333 but I am not sure how to combine it with the line above in a non-awkward way. 回答1: Research a bit before as there are answers available. Anyhow,

Android how to identify item in listview with checkbox

会有一股神秘感。 提交于 2019-11-26 09:55:29
问题 I am really stuck here. What I want is not simple (for me), however I\'ve been programming android a year now. What I want is a listview with an imageview, a textview, a checkbox, and another textview in each row. Let\'s have a textview and a checkbox first in the layout. Based on this tutorial I managed to do that (there are a lot, but this seems to be the best for me). I have a listview populated with textviews and checkboxes. This is the result: This is how I get the text of textview I

Loading remote images

拟墨画扇 提交于 2019-11-26 09:51:40
问题 In Android, what is the simplest approach to the following: Load an image from a remote server. Display it in an ImageView. 回答1: Here's a method that I actually used in an application and I know it works: try { URL thumb_u = new URL("http://www.example.com/image.jpg"); Drawable thumb_d = Drawable.createFromStream(thumb_u.openStream(), "src"); myImageView.setImageDrawable(thumb_d); } catch (Exception e) { // handle it } I have no idea what the second parameter to Drawable.createFromStream is,

Mask ImageView with round corner background

*爱你&永不变心* 提交于 2019-11-26 09:16:16
问题 I am having a Custom ListView which contains an ImageView and TextView . Everything is working fine. What I want is the image is displayed in list are in round corner. From the Webservice i get the images in rectangle shape. But i want to display it in Round corner ImageView as below. Can anyone show me the way how can i mask the image in round corner? I already tried by creating the drawable file as below and applied it as src in ImageView . But nothing working for me. <layer-list xmlns

Adding Fling Gesture to an image view - Android

戏子无情 提交于 2019-11-26 09:06:20
问题 Okay I have been referencing the code here: Fling gesture detection on grid layout but just can not get it to work. In my main activity I have a simple image defined. I want to detect a fling on the image. Here is my code below. The onclick method at the bottom is empty. Is it because of this? I left it blank because in the other code sample its not what I want. I just want a simple toast to pop up saying fling right or fling left. public class GestureRightLeft extends Activity implements

Android — How to position View off-screen?

守給你的承諾、 提交于 2019-11-26 09:05:33
问题 I\'m trying to animate a simple ImageView in my application and I want it to slide in from the bottom of the screen and come to a resting position where the top 50px of the view is off the top of the screen (e.g. the final position of the ImageView should be -50px in X). I\'ve tried to use the AbsoluteLayout to do this, but this actually cuts off the top 50px of the ImageView such that the top 50px is never rendered. I need to have the top 50px of the ImageView visible/rendered while it\'s

Android: how to convert whole ImageView to Bitmap?

梦想的初衷 提交于 2019-11-26 08:49:26
问题 I have my application that is displaying images with different ratio, resized inside (centerInside) imageView. What I need is to create bitmap from the ImageView including the background (black in this case). So for example I have device screen 320x480, full screen imageView with image resized to 280x480. How could I get 320x480 bitmap from it? On top of this imageview I have some logos or buttons that I don\'t want to include to bitmap, they\'re like on top layer. All I need is bitmap with

how to set image from url for imageView

半腔热情 提交于 2019-11-26 08:13:21
问题 I wanna set Image in ImageView using Url for example I have this url http://www.google.iq/imgres?hl=en&biw=1366&bih=667&tbm=isch&tbnid=HjzjsaANDXVR9M:&imgrefurl=http://www.vectortemplates.com/raster-batman.php&docid=FxbVmggVf--0dM&imgurl=http://www.vectortemplates.com/raster/batman-logo-big.gif&w=2072&h=1225&ei=Zeo_UoSWIMaR0AXl_YHIBg&zoom=1 but there is no option to set url 回答1: EDIT: Create a class that extends AsyncTask public class ImageLoadTask extends AsyncTask<Void, Void, Bitmap> {

Change Image of ImageView programmatically in Android

北城以北 提交于 2019-11-26 08:11:33
问题 When I change the image programmatically‎, it shows new image on top of the old image which is set originally in layout file? Here is a snippet of my layout file: <LinearLayout android:layout_width=\"match_parent\" android:layout_height=\"39dp\" android:gravity=\"center_vertical\" > <ImageView android:id=\"@+id/qStatusImage\" android:layout_width=\"16dp\" android:layout_height=\"16dp\" android:layout_margin=\"5dp\" android:background=\"@drawable/thumbs_down\" /> <TextView android:id=\"@+id