imageview

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

淺唱寂寞╮ 提交于 2019-12-03 05:21:28
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:src="@drawable/icon" /> <EditText android:id="@+id/text" android:layout_width="fill_parent"

android 9-patch graphic doesn't scale in image view

廉价感情. 提交于 2019-12-03 05:19:52
问题 I have <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal"> <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:id="@+id/ImageView01" android:src="@drawable/phone80"></ImageView> <ImageView android:id="@+id/ImageView02" android:layout_height="wrap_content" android:src="@drawable/underline" android:layout_width="fill_parent" android:layout_gravity="fill

selector not working with layout and image view

会有一股神秘感。 提交于 2019-12-03 05:04:51
问题 I want to use selector for a layout and image view..But it is not working for me. When I changed image view to imagebutton or button, it works fine. Any help will be greatly appreciated.. Thanks in advance.. here is the xmls I used.. <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:drawable="@drawable/bg" /> <item android:drawable="@drawable/bg_01" /> </selector> The layout xml: <?xml

Android - ImageView bottomCrop instead of centerCrop

柔情痞子 提交于 2019-12-03 05:01:06
问题 I'm trying to position an ImageView so that the bottom of the image is always pinned to the bottom of the view, no matter how small the height of the ImageView is. However, none of the scale types seem to fit what I am trying to do. CenterCrop is close, but I don't want the image to be centered. Similar to how CSS would handle absolute positioning. The reason is, I need to animate the height of the ImageView, but make it seem as though it is "revealing" the upper portion of the image. I

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

半城伤御伤魂 提交于 2019-12-03 04:58:05
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, 48px and 72px in ldpi , mdpi and hdpi respectively. All the images that will be used in this ImageView

Image View not Wrapping Contents

守給你的承諾、 提交于 2019-12-03 04:41:13
问题 I've got an ImageView wrapping this image: <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:scaleType="fitStart" android:src="@drawable/oncmap"/> and right below it, a TextView. Unfortunately, it either pushes it down the view or out of the view depending on the device's screen size. http://i.imgur.com/CuVFK5P.png http://i.imgur.com/6wzMebV.jpg I can "hack" it, but it'd rather not... <LinearLayout xmlns:android="http://schemas.android.com/apk/res

How to Set BackgroundColor on ImageView on Android?

拈花ヽ惹草 提交于 2019-12-03 04:22:28
I tried a couple things and nothing is working... I'm trying to change the BackgroundColor on a ImageView on Android, but nothing happens... Here is my xml: <ImageView android:id="@+id/imageView1" android:layout_width="350dp" android:layout_height="550dp" android:layout_above="@+id/btnInfo" android:layout_alignLeft="@+id/fundo" android:layout_alignRight="@+id/btnInfo" android:layout_alignTop="@+id/fundo" android:layout_centerHorizontal="true" android:contentDescription="@string/backgroundMain" /> And the code: public void onStart() { super.onStart(); Log.d("Teste", "In the onStart() event 5");

Android set bitmap to Imageview

南楼画角 提交于 2019-12-03 04:19:56
Hi i have a string in Base64 format. I want to convert it ot a bitmap and then display it to an ImageView. This is the code: ImageView user_image; Person person_object; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.user_profile_screen); // ImageViews user_image = (ImageView) findViewById(R.id.userImageProfile); Bundle data = getIntent().getExtras(); person_object = data.getParcelable("person_object"); // getPhoto() function returns a Base64 String byte[] decodedString = Base64.decode(person_object.getPhoto(), Base64

How to make a crop camera view on SurfaceView Android

青春壹個敷衍的年華 提交于 2019-12-03 04:04:43
I want to create an cropping application using surfaceview on the android operating system. I've made ​​a display surface for displaying direct view camera, but I still fails when I want to add a cropping feature directly on the camera display. Figure edits below this is going to accomplish: When the capture button is clicked then the images result will appear on the screen, as shown below: The following is the source code MainActivity.java package com.example.CameraPreview1; import java.io.IOException; import java.util.List; import curso.citic15.camara.R; import android.app.Activity; import

Passing image to another activity

纵然是瞬间 提交于 2019-12-03 04:01:43
I figured out how to pass a String value between activites thanks to this site, however I'm having trouble passing an image. What I'm trying to to is have a user click a button that opens the gallery and allows selecting of a picture. Then I have another button that opens another activity that displays an ImageView. I want to be able to have that ImageView's image be the chosen one from the previous activity. Here is the class that has the button I'm clicking to open the gallery and retrieve the chosen image: public class EnterEdit extends Activity implements View.OnClickListener { private