imageview

Android ImageView Zoom-in and Zoom-out Continuously

这一生的挚爱 提交于 2019-12-04 10:22:27
问题 Is there any way to Zoom-in and Zoom-out an ImageView continuously in Android. I tried using the below code, but only one of the Zoom function is working. zoomin.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true" > <scale xmlns:android="http://schemas.android.com/apk/res/android" android:duration="20000" android:fromXScale="1" android:fromYScale="1" android:pivotX="50%" android:pivotY="50%" android:toXScale="3"

ImageView: adjustViewBounds does not work with layout_height=“fill_parent”?

若如初见. 提交于 2019-12-04 10:15:07
问题 I'm trying to place in single row the EditText with the ImageView on the left. But I can't get the image to be scaled properly to match the height of text entry. The layout is simple: <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustViewBounds="true" android:scaleType="fitStart" android:background="#f00"

Android: How do you scale multiple views together?

江枫思渺然 提交于 2019-12-04 10:13:07
I'm trying to layer graphics one top of each other, like an icon over a background, with the second layer (icon) at a certain pixel offset from the top left corner of first layer (background). Since each layer will eventually have its own animation, I'm placing each in its own View. For my implementation I have two ImageViews, one for each layer, inside a RelativeLayout, which in turn is inside a ScrollView. ImageViews are positioned using layout_margin relative to the top left corner (0,0). The first ImageView is larger than the screen (background), while the second ImageView is smaller than

Setting ImageView ScaleType to “center” is not working as I expect it

橙三吉。 提交于 2019-12-04 09:59:06
问题 I have the following layout for my ImageView : <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:descendantFocusability="blocksDescendants"> <ImageView android:id="@+id/imageview_icon" android:layout_width="48dp" android:layout_height="48dp" android:scaleType="fitCenter" /> (...) </LinearLayout> Those 48dp equal to 36px,

Rotate ImageView source from layout xml file

心已入冬 提交于 2019-12-04 09:51:37
问题 I have this ImageView in my layout: <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:contentDescription="@string/image_divider" android:paddingBottom="8dp" android:paddingTop="4dp" android:scaleType="fitXY" android:src="@android:drawable/divider_horizontal_textfield" /> It's a horizontal divider. I want to rotate it 90 degrees so I have a vertical divider. Is there any possible way to do it right here from the layout and not the Activity class? 回答1:

How to clear ImageView correctly?

佐手、 提交于 2019-12-04 09:13:45
问题 For example, in my Activity I have such code (I skip the initialization of variables): ImageView iview; //some ImageView Bitmap b; //some Bitmap iview.setImageBitmap(b); Question is - how to clear iview resources correctly (with or without destroying view) ? Would ImageView free it's resources (used in native code) after b.recycle() ? I suppose, that ImageView doesn't just free it resources after Activity onStop (or onDestroy ). 回答1: imgview.setImageResource(0); or imgview.setImageDrawable

Full size image in ImageView

◇◆丶佛笑我妖孽 提交于 2019-12-04 09:09:48
I'm trying to draw an image in an ImageView, but i want it to be unscaled, with scrollbars as necessary. How can I accomplish this? Right now I just have a drawable set as the android:src of the ImageView in the XML. This autoscales the image to fit the screen width. I read that this might be because of the compatibility mode (developing for 1.5, testing on 2.1), but then I added <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4" /> to my manifest, and nothing changed. Any clues? -- Edit: I used android:scaleType="center" on the ImageView, and this displays the full image (can't

Image out of bounds after transformation on view

南笙酒味 提交于 2019-12-04 09:03:22
I'm having a problem with displaying my image. I have an Image I want to display full screen. So I have this Imageview with match_parent and 20dp padding. It looks good but when I apply rotation on it, it seems that the bounds of the view doesn't change and the image can get clipped out of the screen ! Totally don't want that to happen! How do I rescale the image so that the image also fits in the ImageView when its 90 degrees rotated. This is my XML WITH rotation in it. EDIT: How to fix the bounds of the Image so the Text is aligned just above the image? The rotation is not taken into account

how to send image from one activity to other?

為{幸葍}努か 提交于 2019-12-04 07:51:22
I need send a imageview like i send the string "title", but i can't, how can i send a imageview (R.drawable.image) from mainactivity to secondactivity? THANKS MAIN ACTIVITY public void NewActivity(View view){ Intent intent = new Intent(this, SecondActivity.class); intent.putExtra("title", getString(R.string.title)); startActivity(intent); } SECOND ACTIVITY @Override public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.pantalla); Bundle extras = getIntent().getExtras(); if (extras == null) { return; } String title = extras.getString("title"); TextView textview =

Image browse button in android activity

a 夏天 提交于 2019-12-04 07:31:26
currently I'm developing an application which requires a browse button in my activity. When I press the browse button I should be able to browse the image files in my sdcard as well as in the phone memory. Upon tapping the image file it should be selected and the path of the image file (that is, where that selected image file is located) should be displayed in the activity in a textview. Also the selected image should be displayed in a imageview. How to do this? Can someone please help me out.. main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android