I am developing an Android app. And i am trying to show a DashBoard. DashBoard is working fine. I have taken gridview to display it, But I want to set the border of that gridview. How can i achieve it ? if anyone can suggest me something useful.
You can override GridView drawing and draw border from there.
You can add rectangular shape as the background.
You can put your GridView inside another layout, set background color for that layout and set margin for the GridView. (not really good as Android has to draw big single-color view and then cover it with GridView)
Lots of ideas here: How do I put a border around an Android textview?
Related
I would like to develop a layout below. I am really confuse related to that. I used RelativeLayout, FrameLayout to develop this. But I am not getting perfect output. As per below image, the Dark Gray color is overlap the light Gray layout. If I used Relative layout then dark Gray will be in the light Gray area. And if I used FrameLayout then the other controls of light Gray will not set perfectly.
Please guide me the right path. I am stuck in this layout. Thanks in advance.
According to your figure, If all widgets need to show without scrolling vertically , you can have vertical linear-layout here,
TextView
Button,
ImageView
List view with defined height
Other widgets
I am using GridView in android application also displaying data from sqlite database to GridView, now my problem is, data has been displayed but I am not able to show grid lines in GridView, so how can I do it?
Set the vertical and horizontal spacing for your Gridview to, say 1dp or 2dp depending on how thick you want the border to be. Then just set the background color of your GridView to the color you need for your borders.
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.
I'm a new Android developer, and I'm just trying to improve my skill by reading some samples, I want to design a new interface using GridLayout, I've checked a lot of samples but I can't seem to draw borders between the GridLayout cells. What could I be missing?
Here is a link that I went through it, but the borders didn't show up!
http://developer.samsung.com/android/technical-docs/GridLayout-in-Android#
I appreciate your care in advance.
Android Layout containers don't draw borders. Still:
You can set background of each cell's View to an xml Drawable resource,
which describes a transparent rectangle with borders.
Give a background color to GridView's parent View, and set each GridView cell View's background to a different color.
Both of these can also be applied as a Style.
I am trying to draw and animate several ImageView items on a screen and I would like to have the images display the blue borders used in other Honeycomb apps (examples of borders here: http://www.youtube.com/watch?v=UPSBctbYc9Q # 1:10).
I've seen hacks/workarounds for older versions of Android using a background image, but I was hoping to avoid that. Can anyone help me to add such borders?
Thanks
I'd suggest just creating a custom view using FrameLayout as its base to layer up the background/border, and then the ImageView on top using an appropriate padding value such that the border remains visible.