android relativelayout xml background image with many relative textviews (dynamic clock) - android

I want to make something like an analog clock with a background image and many TextViews.
The TextViews will get the data programmatically, which is working. But my problem is the design. How can I set the TextView's position in relation to the background image? It should work on different screen sizes ...
Is there maybe a way to take the middle of the screen and set a margin to the center for each of them, like I foretold with the arrow in the picture?

Related

How to make a textView stick to the same position on imageView background with different screen ratios

-I'm new to constraintlayout and I want to constraint a textview in some specific places on imageView like in here
-I tried to use guidelines anchoring the text to them like this but it didn't show the same between different screen sizes
so I need a way to connect the text to the image in way the text be all the time in the place I needed to be in different ratios
My suggestion would be to anchor each of your views to the top and bottom of the page and then set the slider % to 25% and 75%. You can adjust the views that way so that they're always relatively similar in positioning no matter the screen size.

Android border around textview just on the base and partially on the right and left walls

I need to get a border on the base of my android text view, it should look something like the count down -1:29 timer. I know I can create a image and put it on the background, but I need it to be a layout xml kinda thingy so that it adjusts with size of the text within for all phones.
Use a 9-patch image that can stretch horizontal and place it as a background. That is all you need.

how to fix android scrollView height?

I'm trying to create a layout with multiple buttons, But all buttons was not displayed on Screen, So i used scroll view but now i have one problem because of background image (which is of high resolution). Now i'm getting very large empty space under after buttons. Please suggest a solution how can i fix scrollView hight so that it doesn't show the space under buttons.
like This :Area with white background is Moblie visible screen and off white area is background image.
The best solution would be to use an appropriately sized image. If you only want to display part of the image, but the image is a high resolution image, then you are wasting resources by loading the entire image.
You could enclose the ScrollView within another View, and set the background of your parent view to be whatever background you desire. Set the height of both views correctly and you should achieve your desired result.
The hierarchy would be
View (with background image)
ScrollView with buttons

How to remove the android Button Background margins?

I'm new to Android dev, I'm trying sth simple: I want to place a set of 3 buttons horizontally in a line, each with its own background PNG image. So I create a linear layout (horiz) and put three Button elements, each with a weight of 1, and set each button's Background property to some png file. The buttons' width/height is set to wrap_content.
But what I get is that the png does not cover the entire button horizontal area. Instead, the background image is scaled down and keeps some sort of margin from the button view outline as shown in the visual designer. This also shows up in the emu. I tried forcing 0 in the layout's padding/margin - nada.
any idea on how to actually get the background image of a button to cover the button's background??
tnx
I believe you would need to make a new 9-patch, as that small margin is saved into the button image itself.
Try negative values for the buttons layout_margin.

how to design this UI in android

i want to show a UI as like the following image
how to show the horizontal and vertical lines between those numbers
See how the lines between the boxes cast shadows? and there is a shine that carries across sections? It looks to me like the that is just a background image with the numbers laid over top of it in certain positions. So do a Relative Layout with a background image.

Categories

Resources