imageview

Android listview item display text over image using array adapter

痴心易碎 提交于 2019-12-11 06:33:52
问题 I have overloaded the getView method of listview to populate custom style of list item. This is what currently it looks like:!! Red color is to just show the background of listview item Here I have used 3 controls: Imageview for image, 2 text views (one top, one bottom). Problem here is the height of listview item is getting increased. I want two textviews over the image not above or below. To someextent I know the root cause of this problem but don't know how to fix it. Here is the layout of

Android ImageView flipping animation

房东的猫 提交于 2019-12-11 06:23:34
问题 I have to show one animation on ImageView . It will like card flipping. The ImageView showing X image will flip and will show Y image. How can I do the same? Any idea? 回答1: You can use this class for flip animation FlipAnimation.class import android.graphics.Camera; import android.graphics.Matrix; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.Animation; import android.view.animation.Transformation; public class

Android Studio onClick button to display ImageView in another activity

三世轮回 提交于 2019-12-11 05:56:21
问题 I have setup 2 activities - one and two . For activity 1, I have a EditText and a button. When user open the app, it will show Activity One(just like the screenshot) to prompt user to key in a number. For example, 1 or 2. What I am trying to do is that: I want to display a ImageView in activity 2 when user key in a number in EditText follow by a click on the button in activity 1. If user key in 1, it will display 1.png in activity 2 If user key in 2, it will display 2.png in activity 2 If

Pick image from gallery and load it into the imageview of the particular activity and into a navigation drawer imageview in another activity

前提是你 提交于 2019-12-11 05:29:50
问题 I have a Activity Profile in which the user can update his profile picture. At the same time I have a navigation drawer in which the updated profile picture should be loaded into the imageview of the navigation drawer.I need a code in which the user can choose image from gallery or camera and crop it to fit into the imageview and the same image should be loaded into the image view of a navigation drawer in the main activity. Here is the code of my ProfileAcitvity In this code we can choose

Android fill ImageView from URL

試著忘記壹切 提交于 2019-12-11 05:28:18
问题 Hi i'm trying to add an image to an ImageView from a URL i have tried loading it as a bitmap but nothing is showing. so does anyone know what the best method to do this is or what i'm doing wrong? heres my code @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); //Check Preferences which sets UI setContentView(R.layout.singlenews); TextView headerText = (TextView) findViewById(R.id.header_text); headerText

How to draw onto an ImageView Bitmap with finger and obtain coordinates and save the drawn image

浪子不回头ぞ 提交于 2019-12-11 04:54:08
问题 Basically i have a grid(stored as an image) like so: What I need to do is draw on this grid with my finger(multiple strokes) and display and save this new bitmap. Additionally, while drawing I need to obtain the coordinates of the stroke so I can calculate some data from it(The whole grid is divided into zones ). The coordinate part was simple, which I did using Rect(), getX() and getY() viz. int getZoneLocation(int x, int y) { Rect rectangle = new Rect(); amslerView.getGlobalVisibleRect

JavaFX- Get image of one ImageView and assign it to another ImageView

三世轮回 提交于 2019-12-11 04:39:58
问题 I am doing an application which user by clicking on an image(ImageView1) can see that in another ImageView2. so I try to get the image of ImageView1 in a variable BufferedImage img= SwingFXUtils.fromFXImage(ImageView1.getImage(), null); And then assign that variable to ImageView2 ImageView2.setImage(SwingFXUtils.toFXImage(img, null)); But it seems however, setImage is done successfully, but ImageView2 is not showing anything. anyone can help me for a better solution? Here is the code example:

Rotating images in Listview

杀马特。学长 韩版系。学妹 提交于 2019-12-11 04:22:53
问题 I am trying to make a fake horizontal ListView. For that, I want to rotate the content of each cell in the adapter. It almost works: class ImageAdapter(ctx: Context, viewResourceId: Int, imageResourceId: Int, strings: Array[String], icons: TypedArray, colorSelected: Int, colorNotSelected: Int, colorBorder: Int) extends ArrayAdapter[String](ctx, viewResourceId, strings) { // Useful variables private val mInflater: LayoutInflater = ctx.getSystemService( Context.LAYOUT_INFLATER_SERVICE)

Android Out of Memory Error when loading images from resource

非 Y 不嫁゛ 提交于 2019-12-11 04:07:28
问题 I have a layout which I'm adding ImageViews (about 13) to at run time using a single thread. When I load more than 7 or 8 images (970px x 970px, 270kb) the application crashes displaying an out of memory error. Now when I load the same image rather than choosing 13 different images it displays fine. And also when I reduce the size of the images (16px x 16px, 770bytes) it displays fine. So does anyone know what the max memory allowed when loading images? What is the best way to get around this

RemoteView setLayoutParams - Change ImageView Size Inside HomeScreen Widget

巧了我就是萌 提交于 2019-12-11 03:37:06
问题 My app shows a widget with a total of 8 buttons. I would like to give the user the possibility to style that widget and customize the size of the ImageViews which are below the buttons. The aim is to leave the Buttons as they are, but to change the ImageView sizes dynamically. For this the User gets to set an icon Size, which is stored in a SharedPreference as an Integer iconSize . How can I change the size of an ImageView in a Widget? For now, the ImageViews are created with the size set in