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.
Related
I have a gridview which height is half of the phone's height and aligned to parent's bottom like below images, (numofcolums=1 i need it that way of other reasons)
But i also need the items in the gridview starts from bottom to up like second image
How can i achieve this with android gridview?
Is it possible or do i have to design custom implementation similar to gridview?
Thanks
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?
I want to generate the following for my Android application.
I tried to achieve this using RelativeLayout and some drawables (empty circle, filled circle, dotted line) I created using XML , but I am not even close to it. Is it the right way to generate such views with layouts. If so, is RelativeLayout is the way to go? Or should I create a custom view for that?
why are there 4 dots between the last item and the one before it, while the other have 3 dots?
anyway, i think you can achieve those results by having a listView with custom items.
each item would be shown as a relativeLayout with 2 imageViews (one below the other) and a textView on the right of the upper one.
the upper imageView would have the large dot (filled or not), with optional dots above it, and the imageView below would stretch its size according to the textView (align to its bottom plus add some more for extra small-dots) and have tiled dots as its background.
another approach would be to have a listView of textViews and an imageView on its left, and you draw the circles according to what the listView is currently showing (even while scrolling). it's much harder, but might be more precise.
I am using GridView to show a summary report of 3 columns in my app. EveryThing seems to work fine except the GridLines for Gridview is missing.
Can anyone please suggest how to display GridLines for GridView and even Headers.
Thanks.
I actually have a much simpler solution.
What you can do is that 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.
Let me know if this works for you.
In my application I want a 5x5 grid view(or table view). I do not want to use image view or text view in side the grid view(or table view).
I just want to put out lines for the cells in side that grid view.
Is it possible and how can I do it?
I also want to take identity of individual cells inside the grid
view (or table view)?
This is grid view and I used image views to make cells visible to users. But with out using this images or any text views I want to display cells.
Thanks for your answers.
Use a square xml drawable as background with stroke set to width and color of your choice, fill color set to transparent and may be rounded corners for extra fancy.
Use these as guide to your code GridView, GridView Example