imageview

Getting id of imageview

て烟熏妆下的殇ゞ 提交于 2020-01-03 05:50:09
问题 I am making a number of imageViews programmatically in a loop and assigning them ids. But when in onClick method I need to get the id of images, it is returning the id of the last image only. How do I get the id of the image that is clicked? The code I am using: for (int j = 0; j < 5; j++) { TableRow tr = new TableRow(this); imageUrl = "http://ondamove.it/English/images/users/"; imageUrl = imageUrl + listObject.get(j).getImage(); image = new ImageView(this); image.setPadding(20, 10, 0, 0);

Android Best way to overlay an item in an ImageView

拟墨画扇 提交于 2020-01-03 05:28:10
问题 Any ideas on how to overlay a View over an ImageView? More specifically I would like to popover view when the user clicks in certain regions of my ImageView. I'm solving this problem drawing the popover view after the image in the onDraw() method but it has been a pain to handle events when the user clicks in the popover. Thanks in advance 回答1: FrameLayout resolves this problem. You can place two children inside the FrameLayout , where the first child will be the background and the second

Android - Imageview Fragment laggy

旧城冷巷雨未停 提交于 2020-01-03 04:50:32
问题 Hi I have a swipe view with corresponding tabs using fragments. The first view only contains a full hd image in the size of about 1.91mb. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView android:id="@+id/imageView1" android:layout_width="match_parent" android:layout_height="match_parent" android:contentDescription="

How to add image to a framelayout in android app ?

妖精的绣舞 提交于 2020-01-03 04:38:10
问题 I am building a left slide menu in my app, in which I am using a framelayout. And a listview is called inside this framelayout. In this frame layout, I want to call a imageView which will display user profile picture. Here is the code for my navigation drawer, where I am initializing framelayout and calling its listview. Here is my navigation drawer code - public class NavigationDrawerFragment extends Fragment { Context context; ArrayList prgmName; public static int [] prgmImages={R.drawable

Saving Camera Bitmap to Storage, and Setting Image with Bitmap

我的梦境 提交于 2020-01-03 04:32:09
问题 I know the basics on how to take a picture and set it to ImageView. photo = (Bitmap) data.getExtras().get("data"); imageView.setImageBitmap(photo); I want to do a little more than that. I am saving it to a folder on to an SD card. That I have done successfully with this: // intent Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file)); startActivityForResult(intent, CAMERA_REQUEST); Here is my next question: Not sure how to do

Align image and text on textview

♀尐吖头ヾ 提交于 2020-01-03 04:18:35
问题 In my app, I populate a linearlayout with a text and a little icon (like a listview with a custom adapter). I need the text and the picture to have the same size. Is there a way to do that? Here's the code: LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT); LinearLayout LayoutPadre = new LinearLayout(this); TextView Tag = new TextView(this); ImageView img = new ImageView(this); Tag.setText(data); if(stato.equalsIgnoreCase(

How to set a clickable region for an ImageView?

半世苍凉 提交于 2020-01-03 02:12:05
问题 I have 2 ImageViews which have AnimationDrawable backgrounds to animate a box opening and closing when you click on it. The 2 images are slightly overlapping (the transparent area) so they can be closer together. The problem this is causing is that I am unable to click on regions of the 1st image where the 2nd image (transparent area) is overlapping. Is there a way to set a clickable region of an ImageView? 回答1: I don't think that you can "define a clickable region on an ImageView" like you

Display images from protected folder

风格不统一 提交于 2020-01-03 00:02:08
问题 I have a protected folder within Yii and I'm looking to display some of those images within the site. I've tried the following code and it works within the site/index controller in that it returns just the image I wanted. However when I tried to separate the code it didn't work. Any help is appreciated. Model public function getImage() // will take file identifier as @param { $imageID = '2562584569'; // will eventually be dynamically assigned $image = Images::model()->find('tmp_name=:id',

Change ImageView size programmatically

落花浮王杯 提交于 2020-01-02 21:25:21
问题 I have a relative layout with 3 ImageViews. The first one is a square image, the second is just used for spacing, and the third one is another square image. Here is the xml code for that layout: <?xml version="1.0" encoding="UTF-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/radioSV" android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width

Create Image from imageview and textview?

社会主义新天地 提交于 2020-01-02 11:20:28
问题 I'm making an app that will allow the user to add a photo to an imageview from the gallery of their phone which I have already been able to code successfully. I now want to be able to allow the user to add text on top of the photo and then save the text and image as one back into the gallery. Is there any way to do this? XML: <LinearLayout android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical" xmlns:android="http://schemas.android.com/apk/res