I'm trying to display an imageView with some buttons on it.
My problem is that I don't find any way to add my buttons at a specifics x and y on the image, can you tell me a function to do that?
Thanks.
You could put the ImageView and a AbsoluteLayout inside a FrameLayout. Then add your buttons to the AbsoluteLayout.
An ImageView is not capable of having children objects within it. The ImageView and Buttons would have to be two child objects within a Layout. If you want the button to appear on top of the ImageView, place the code for the Button after the ImageView code in the layout.
Related
I want to make a custom layout like below view.
In this view I want to make TextView half sliced from one end and another ImageView from another end. So please tell me how to make such custom TextView and ImageView with diagonal clipped from one side.
With reference from this answer you can use this view and customize it horizontally instead of vertical.
Or you can also check for this code as well which something like below image.
Reference also available here
How can i cover the screen by TextView i written Below but it does not work
I want the Facebook buttons to show sometimes i dont want them to show i just want to show a
Thank You for your help
Either re-order your RelativeLayout to place the element you want on top at the bottom of the layout list, or use a FrameLayout. A FrameLayout will allow you to overlay elements.
See here:
Android overlay a view ontop of everything?
The problem here is very simple. You are adding your TextView first and then you are adding ImageView. Both these are set to match parents width and height but since you are adding ImageView later its z-index is greater than that of TextView.
To confirm these just remove the ImageView and then check.
Hope this helps :)
I have RelativeLayout with a number ImageViews, which are added dynamically. Each view overlap 80% of previous view. I want to add onClick listener for views, but I have a problem:
OnClick event works like I've clicked on the last (top) view, even if I clicked on any other.
newly added view's are overlapping by a fixed proportion (80 % ) so you can relate cordinate of touched point and selected view easily . so instead of ClickListener on ImageView use a touchListener on RelativeLayout .
for more help share your code .
It could be possible that, although the image inside the ImageView is.. say 100x100px, that the ImageView itself is taking up the rest of the screen with the image resource centered.
Hard to say without code.
I want put a picture at the top of the screen and then a description as a text view under the picture and finally on the bottom a list view. How can I do this?
You just need to create a LinearLayout and add imageView in it. Then add a listView to LinearLayout.
Alternatively, create a RelativeLayout, add imageView in it and add listView by setting attribute android:layout_below:"#+id/yourImageViewId".
I am trying to create an UI just like the attached image!
How do we create these types of UI? Is it a ListView? And how do we get the arrow button on the right hand side? How should I start with such kind of layouts?
You can achieve that with a LinearLayout too.
Have that LinearLayouts orientation be vertical. Create such list items (it isn't related to ListView) using RelativeLayout.
Have the icon be an ImageView aligned to its parent left and vertically centered, the text would be a normal TextView which is to the right of that icon and vertically centered as well and finally another ImageView but this time aligned to its parents right and vertically centered.
These is the receipt.
It's a ListView, you should learn how to write your own ArrayAdapter and returns in the getView method the View you want to be each row of the ListView.
AnDroidDraw lets you create the layout online and then later download it on your device. http://www.droiddraw.org/
Create appropriate custom ArrayAdapter for this layout.