imageview

Image from URL in ListView using SimpleAdapter

眉间皱痕 提交于 2019-12-11 09:46:32
问题 I hope you can help me with this error, I'm stuck in this for a few days. I want to show a ImageView from URL in a ListView using SimpleAdapter, but the image are showing in white. I'm recent starting with android, so, i cant understand a lot about LazyList and other stuff.. How i can implement my code to work with ImageView from URL? Here is my AsyncTask to does all work. class LoadAllProducts extends AsyncTask<String, String, String> { @Override protected void onPreExecute() { super

Android: Display image over an Image in ImageView

☆樱花仙子☆ 提交于 2019-12-11 08:59:42
问题 I'm using LinearLayout to place two ImageView horizontally. I have image placed on ImageView . Now I need to add an small image over the image on ImageView . I have seen a lot of post but all of them deals with Relativelayout or Framelayout . Here is the XML code segment that I have used. <LinearLayout android:id="@+id/relativeLayout2" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:orientation="horizontal" > <ImageView android

Android Imageview in Listview onClick change image doesn't work properly

心已入冬 提交于 2019-12-11 08:51:40
问题 I have a ListView and in every single ListviewItem there is an ImageView with a little star (for marking it as favourite). Therefore I put an OnClickListener to the ImageView on every item in the custom ArrayAdapter. imgStar.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Bitmap bitmap = ((BitmapDrawable)imgStar.getDrawable()).getBitmap(); Bitmap bitmap2 = ((BitmapDrawable)(context.getResources().getDrawable(R.drawable.ic_action_not_important))).getBitmap();

How to make a photo zoom, setting aspect ratio and then zooming leaves white area in Swift?

三世轮回 提交于 2019-12-11 08:36:32
问题 [After scrolling : Problem White Screen]1 After Zooming [Before Zoom image setted aspect ratio] I am implementing a photo view page, which includes just a photo. Functionalities : Zoom. As the image is of size 1024x510. I have implemented aspect ratio and set the imageview frame to the screensize. I have implemented using Scrollview and imageview concept. The problem is that, when I zoom the image white screen is also zoomed. Problem is the white space os imageview while zooming. . Code

Drawing a line in a class which extends "Activity'

拜拜、爱过 提交于 2019-12-11 08:09:00
问题 I have an ImageView loading a picture in my Activity and want to draw some lines on it. It seems like I'm not able to overlay the lines I draw onto the ImageView. If I create a new class (myPainter) which extends 'View', hook myPainter.onDraw() and then setContentView(mp) in onCreate() from the activity, all I get are the drawn lines. My ImageView is gone from onCreate(). How do I get the ImageView and lines to show up in the same layout? I'm also Override'ing onTouch() for the ImageView so I

How to set image in ImageView?

北城以北 提交于 2019-12-11 07:57:19
问题 I need to put my own image on some imageView . So that's why I created folder named "drawable" in res folder , and copy my Image in this folder , but now I don't know how to set this image to my imageView in XML code. Can anybody help? and sorry for English :) 回答1: In your layout XML file: <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/your_image_name"/> Replace your_image_name with the name of the image file without the extension (e

Why this image-switching code has memory leak?

半世苍凉 提交于 2019-12-11 07:57:13
问题 I'm write a simple android application, which uses an ImageView to display an image. When click on a button, it will generate a new bitmap based on current image, and replace the old one. The image I used is not big: 220 x 213 . But in the emulator, when I click the button the 5th time, it will throw an error: java.lang.OutOfMemoryError: bitmap size exceeds VM budget I've read some articles: java.lang.OutOfMemoryError: bitmap size exceeds VM budget - Android http://androidactivity.wordpress

GridView not stretching to all screens

可紊 提交于 2019-12-11 07:40:04
问题 I have a GridView that is showing 2 images on a row. I have an SGS and Galaxy 5 to test the app. Unfortunately, it's not well scaling. I change values attributes in XML to fill the screen of SGS and when i test in Galaxy 5 it's bad, very bad. I don't know what to do. Please try to help me, the GridView is my main layout that launches other activities. XML: <?xml version="1.0" encoding="utf-8"?> <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview"

android:load image from sdcard with picasso

若如初见. 提交于 2019-12-11 06:50:57
问题 is it possible to use picasso library to load image from sdcard to imageView ? 回答1: As picasso doc provided, Resources, assets, files, content providers are all supported as image sources. You can simply do like it String filename = "YOURIMAGE.png"; String path = "/mnt/sdcard/" + filename; Picasso.with(context).load(new File(path)).into(imageView); Edit As @Budius suggested, the better way to access file from disk path, use Enviroment class. String filename = "YOURIMAGE.png"; String baseDir =

How to remove white space showing on top of scrollView

荒凉一梦 提交于 2019-12-11 06:43:31
问题 I have the following scrollView. Everything works exactly as I want, except: there is a white space between the top of the scrollView and the top of the ImageView. What I want is for the image to be flushed at the top. It would be great too if the scrollView does not scroll past the bottom edge of the image as well. Thanks for all suggestions. <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:scrollbars="none" > <LinearLayout android:layout_width=