imageview

Android: can't remove vertical gap between images in LinearLayout

和自甴很熟 提交于 2019-12-03 06:48:13
问题 I have a simple LinearLayout in Android with two images vertically: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res/com.eataly.android" android:orientation="vertical" android:background="@android:color/white" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable

Multiple animations on 1 imageview android

你说的曾经没有我的故事 提交于 2019-12-03 06:48:01
问题 I have 2 animations which are already working, i want to fade my train + tween my train on the same time. If I execute 1 of these lines it works. But if I try to execute both it, only 1 will work.. I really can't find a solution here. Maybe you can help? final ImageView mytrain = (ImageView) findViewById(R.id.train); final Animation traintween = AnimationUtils.loadAnimation(this,R.anim.treinanimation); final Animation trainfade = AnimationUtils.loadAnimation(this,R.anim.trainfade); mytrain

Uri returned after ACTION_GET_CONTENT from gallery is not working in setImageURI() of ImageView

空扰寡人 提交于 2019-12-03 06:38:42
I am fetching Uri of a image from gallery using Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Choose Picture"), requestCode); and trying to display the image by imageView.setImageURI(uri); here, uri is Uri of the image received in onActivityResult by intent.getData(). but no image is being displayed. Also, for File file=new File( uri.getPath() ); file.exists() is returning false. Mohammed Azharuddin Shaikh The problem is that you getting the Uri but from that uri you have to create

Android imageview get pixel color from scaled image

牧云@^-^@ 提交于 2019-12-03 06:25:03
问题 My home automation app has a feature where people can upload images to their phone with floorplans and dashboards that they can use to control their home automation software. I have them upload two images: one visible image with the graphics that they want displayed, and a second color map with solid colors corresponding to the objects they want to target areas from the visible image. Both images have to be the same size, pixel-wise. When they tap the screen, I want to be able to get the

Only the original thread that created a view hierarchy can touch its views

大憨熊 提交于 2019-12-03 06:17:04
I'm trying to get an ImageView to animate between 2 images in my drawable folder. I thought everything would work fine, but the log is showing an error: Only the original thread that created a view hierarchy can touch its views. Heres my code: public class ExerciseActivity extends Activity { private ExercisesDataSource datasource; private Cursor cursor; private ImageView image_1_view; private Timer _timer; private int _index; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_exercise); datasource = new

ImageView in android XML layout with layout_height=“wrap_content” has padding top & bottom

独自空忆成欢 提交于 2019-12-03 06:11:48
问题 I have a vertical LinearLayout containing an ImageView and a few other layouts and views. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="wrap_content" android:contentDescription="@string/banner_alt" android:src="@drawable/banner_portrait" /> <TextView

Text overlay over imageview in android

微笑、不失礼 提交于 2019-12-03 06:09:54
问题 I am trying to have textviews overlay over imageviews. Something like this Can someone help me with the code. 回答1: I had the same problem and solved it using a custom gridView. You must apply this in getView. Custom gridView XML: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/layout_practitioner" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <ImageView

Android pinch zoom large image, memory efficient without losing detail

时间秒杀一切 提交于 2019-12-03 06:07:12
My app has to display a number of high resolution images (about 1900*2200 px), support pinch zoom. To avoid Out of memory error I plan to decode image to show full screen by using options.inSampleSize = scale (scale was calculated as Power of 2 as Document) (My view i used is TouchImageView extends of ImageView ) So i can quickly load image and swipe smoothly between screens(images). However, when i pinch zoom, my app loses detail because of scaled image. If i load full image, i can't load quickly or smoothly swipe, drag after pinch zoom. Then i try to only load full image when user begin

Android ImageView Zoom-in and Zoom-out Continuously

不打扰是莪最后的温柔 提交于 2019-12-03 05:41:05
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" android:toYScale="3" > </scale> </set> zoomout.xml <?xml version="1.0" encoding="utf-8"?> <set xmlns

Elevation not working for ImageView

江枫思渺然 提交于 2019-12-03 05:28:59
Elevation for ImageView is not working. I declared ImageView in XML like this: <ImageView android:id="@+id/image" android:layout_width="100dp" android:layout_height="50dp" android:elevation="10dp" android:src="@drawable/youtube" /> What else should I do for elevation to work properly for ImageView? The elevation shadow is derived from the background drawable of a View. If your ImageView has no background, you'll see no shadow. If you want to change that behavior, you need to build your own ViewOutlineProvider and call View.setOutlineProvider() to set it (and this is not trivial). Works in all