I have a problem in animating image like marquee of a TextView.
For example, if the image is translated to X-axis by 50 pixels to right, the 50 pixels in the left is will be filled by translated 50 pixels (the width of image is no changed).
Original: xxxxx50pixels, after Changed: 50pixelsxxxxx
Is there anybody can suggest me a solution?
Thanks for your help.
If you want animation with only one image then you can use .gif image for marquee effect.
Related
Im facing the next problem: I have an imageView that change the size programmatically because de density hdpi has a 480x800 resolution. I change the size with layoutParams.
After I change the size, I want to position the imageView. When I position the view for example to the coordinate (0,0) I saw that between the imageView and the limit of the screen is a little space, like 25 inches. The imageView moves to other place and when I want to position it again to (0,0), the space between the imageView and the limit of the screen disappear. Why is happening that? I need to fix that because the first time is showing wrong, I don’t want the space!
Hope your understand
Greets
I am using 9 patch images in my application.I set my 9 patch image as text background.Now it is resizing in height only.Width of the image remains the same.How to fix this?
for 9-patch images, the marked-top-edge and the marked-left-edge are the extendable edges, however the marked-bottom-edge and the marked-right-edge are which limit the contents' position.
If you want to resize the width but marked the bottom-edge nor the top-edge, the 9-patch image can't be what you want.
In a 9patch image, top edge shows the width area to be expanded. Just make sure you have only highlighted the to be expanded area on of top edge.
If your image is like the bubble below or almost similar, then the nine-patch should have the top edge specifying the width that should expand, the left edge to present the height. The bottom and right edges are for the regions within which the content should be displayed, you could experiment with that.
EDIT: As per Artoo Detoo (changed the right and the bottom edges)
I have been trying to make a circular TextView. Its a circle in which I want to accomodate whole space above a circular bubble as shown in image below.
Kindly see attached image.
In this image, we have a circular bubble with circular text in it.
I have already tried setting oval shape .xml as background of TextView but still no luck.
Edit:
As text length increase. It must reduces in size to fit inside the circle. This is the hardest part to think about.
You need to create a custom view, extending from TextView probably, setting the circle as background image, and calculate the text width / break the lines manually according to the width of the text.
To calculate the width of a string, see How to calculate string font width in pixels?
Some math and calculations is required of course to measure the available space per line; but I think that's the only way, as there's no standard component out there to do it.
To place the text onto the view, use drawText of the Canvas class.
I have an image which is actually 393 x 21 px, which I would like to set on the bottom of my View.
The problem is that, even if i set the width and the height to fill_parent, my image stays very small in the middle of the screen bottom and on the left and the right I have an empty field.
I can resolve this by reducing the Image width size mannualy but is ther any other solution whic could set the image in fullscreen ?
Thank you.
//in your xml Image attribute as
android:scaleType="fitXY"
or //using thru programatically
imgview.setScaleType(ScaleType.FIT_XY);
i want to increase the size of ImageView/ RelativeLayout by Dragging the corner of ImageView/ RelativeLayout. But no difference in width and set it bottom. I set it by using android:layout_alignParentBottom="true" and also set image in imageview. but how to drag i don't know. Is there is any option available in Android? can any one suggest some solution for this? pls help me
you can use onTouch() for the ImageView.
Once it is touched show a small image at the edge of the imageview. And on touching that image and moving(onTouch() gives the pixel positions until you touch it) you will be getting the pixel positions. Based on that you can set the height and width of the imageview.