All Questions

Tagged with
Filter by
Sorted by
Tagged with
246 votes
1 answer
125k views

GridView VS GridLayout in Android Apps

I have to use a Grid to implement Photo Browser in Android. So, I would like to know the difference between GridView and GridLayout. So that I shall choose the right one. Currently I'm using ...
Lakshmi Sreekanth Chitla's user avatar
39 votes
7 answers
62k views

Grid Layout Vs. Table Layout

I am working on a booking engine android app like an airline booking system. To fetch the content of say all the available airlines specific to a passenger search, this is then displayed on the mobile'...
learn_andrd's user avatar
  • 1,046
36 votes
6 answers
42k views

Heterogeneous GridLayout

I am trying to implement the layout below: I guess GridLayout is suitable for my needs but after 2 hours of struggle I couldn't create even a similar layout.. The layout is resizing itself wrongly, ...
C.d.'s user avatar
  • 9,956
34 votes
6 answers
63k views

Set rowSpan or colSpan of a child of a GridLayout programmatically?

I have a GridLayout with 5 columns and 3 rows. Now I can insert arbitrary child views, which is great. Even better is, that I can assign columnSpan=2 to some item in order to span it to 2 columns (the ...
The_Unknown's user avatar
  • 1,008
27 votes
4 answers
8k views

GridLayout spitting out "inconsistent constraint" debug-level logs

I've been using GridLayout for a few weeks now and I've noticed that when I call gridLayout.requestLayout() it spits out the following debug-level message in LogCat: D/android.widget.GridLayout(...
mdupls's user avatar
  • 2,012
25 votes
5 answers
37k views

android.support.v7.widget.GridLayout cannot get it to work

I have an android project which utilizes GridLayout in most of its menus and screens. The problem however is that GridLayout is supported from API 14 and onwards. Since I want to make the ...
user475680's user avatar
19 votes
3 answers
21k views

How to add android.support.v7.widget.GridLayout into intelliJidea?

I want to add GridLayout into my android project which is use support library GridLayout v7. I found this thread but maybe a few steps of adding this library did not mention in this paragraph Set up ...
Misagh Aghakhani's user avatar
16 votes
2 answers
28k views

Android: How to create a GridLayout [not GridView] programmatically?

I am developing a "match the following" application. The xml used for the application is as follows: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/...
Srikanth's user avatar
  • 306
15 votes
7 answers
33k views

Auto fit according to screen size in grid layout android

I have created a grid containing full of texts. I want the text to auto-fit according to screen size. I have tried the following code, DisplayMetrics displayMetrics = context.getResources()....
Anusha's user avatar
  • 949
14 votes
2 answers
12k views

How to make Android GridLayout compatible to older version?

New GridLayout for Android 4 is good. Both in terms of code maintainability and performance. I wanted help with backward compatibility for GridLayout for older version. Waiting for official ...
Siddharth Menon's user avatar
13 votes
1 answer
13k views

Don't understand how to use GridLayout.spec()

This GridLayout is going in my app that has a lot of levels. Each level has a different number of rows and columns. I assume that this GridLayout would be my best bet to use to satisfy my needs. ...
Matt's user avatar
  • 3,902
12 votes
3 answers
10k views

Dynamic height of TextView within a GridLayout

I have a problem using GridLayout using library compatibility (not tried without). I am using app:layout_gravity="fill_horizontal" instead of android:layout_gravity="fill_horizontal" but all the ...
Jul's user avatar
  • 1,039
11 votes
2 answers
4k views

IntelliJ: Getting GridLayout work

I try to use GridLayout in my App, but it wont work. I used this Tutorial: IntelliJ and android.support.v7.widget.GridLayout But it still wont work. I get the following Error: error: No resource ...
Prexx's user avatar
  • 2,969
10 votes
1 answer
8k views

GridLayout from support library does not show 2 rows on Android 2, onChildVisibilityChanged Error

Has anybody gotten the support library to render a grid layout correctly in Android 2? Instead of 2 rows and columns I get a single row on the screen and see this error in the logcat output: Android ...
Beth Mezias's user avatar
9 votes
4 answers
25k views

Eclipse giving an error of android.support.v7.widget.GridLayout failed to instantiate

I have tried to incorporate the GridLayout from the support library, but it is not working. My target build is for API version 10. The XML code I am using is shown below: <?xml version="1.0" ...
Aviral's user avatar
  • 1,141
8 votes
1 answer
15k views

GridLayout vs TableLayout

I'm unsure as to what the differences between the two of them are and which I should use for my purpouses? What I'm trying to do is create a custom virtual numpad with text inputs and that can ...
meds's user avatar
  • 22.5k
8 votes
1 answer
4k views

Programmatically creating a GridLayout from support library

In android, is it possible to create a GridLayout from the support library entirely programmatically (i.e. without writing corresponding xml)? I create my GridLayout in a fragment (called ...
sgdesmet's user avatar
  • 627
8 votes
1 answer
3k views

Hide row in GridLayout

I have made a GridLayout in an xml file with 3 columns and 2 rows. How can I hide the second row via code? I tried to set visibility gone for the views inside that row but the first column seems to ...
Daniele Vitali's user avatar
7 votes
3 answers
9k views

Android gridlayout overflowing screen

I have this code: <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:...
Ogen's user avatar
  • 6,559
7 votes
2 answers
19k views

Android, Horizontal and Vertical Scroll for GridLayout

I'm having trouble getting a GridLayout to scroll horizontally. I found a similar question Gridlayout + ScrollView. I tried that method, but it didn't work. It cuts out many tables (because it was ...
Nivaldo Bondança's user avatar
7 votes
4 answers
14k views

Android GridLayout get row/column

I have a 3x3 GridLayout with buttons. These buttons have a onTileClicked() listener. Now I want to get the position of the clicked button in the grid. Here is my code: public void onTileClicked(View ...
VoidCatz's user avatar
  • 365
7 votes
1 answer
15k views

Horizontally center Views inside Android GridLayout

We are writing an app targeting ICS+ and believe a GridLayout is the best layout paradigm, but it seems very little has been written about it, and we are having some alignment issues. <GridLayout ...
RealCasually's user avatar
  • 3,603
7 votes
2 answers
466 views

Alignment not right when adding view dynamically to GridLayout

When added buttons by XML - All good <GridLayout android:id="@+id/social_gl_content" android:layout_width="match_parent" android:layout_height="match_parent" android:...
Vipul J's user avatar
  • 6,671
7 votes
4 answers
912 views

dynamically created imageview in gridlayout not working

I want to set captured image to dynamically created imageview in same gridlayout but it creates a new grid layout and sets the captured image to the new gridview. This is my mainactivity.java file ...
Ajin kumar's user avatar
6 votes
3 answers
16k views

GridLayout in Kotlin?

I am trying to get a 2x6 (WxH) GridLayout in my Kotlin Android application. I have my xml and fragment / adapter set up for a RecyclerView but am a bit at a loss for as how to apply a GridLayout to ...
arcade16's user avatar
  • 1,535
6 votes
1 answer
3k views

SetGravity for GridLayout not working

I am using a simple GridLayout to which I'm adding buttons dynamically. <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/tagGridLayout" android:...
RaWa's user avatar
  • 123
6 votes
1 answer
10k views

Gridlayout with borders

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 ...
user avatar
6 votes
3 answers
3k views

How to center content of GridLayoutManager?

Just trying to center my RecyclerView horizontal. Here is the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/...
Aaron Waller's user avatar
6 votes
0 answers
2k views

Dynamic Android Grid Layout with custom positioning and sizing of children

I'm currently trying to create an Android grid layout from custom elements(taken from a db) and am in need of suggestions on how to implement it. The grid should have 6 columns and it should be scroll ...
inf1ux's user avatar
  • 283
5 votes
2 answers
7k views

Android - Get all children of a GridLayout?

How can I get all the children of a GridLayout? In my GridLayout, I'm adding views with blahblah.addView(child), not through XML. The GridLayout is set out a bit like this: +++++++++ ++++++++++ ...
Groot's user avatar
  • 493
5 votes
2 answers
8k views

Apk installed on the device but I don't see it in the apps

I wanted to tweak a piece of sample code from API Demos group - GridLayout0. For it I created a separate project and copied GridLayout0.java into it. Now when I try to see the results of my changes, I ...
Rakhilya Lála Ibildayeva's user avatar
5 votes
2 answers
16k views

Align Buttons in GridLayout

My layout code and its graphical representation is: This is just an example, I have about 30 Buttons in my application inside a GridLayout. I want my Buttons to fill their entire cell in the grid and ...
Aviran's user avatar
  • 5,260
5 votes
1 answer
17k views

Gridlayout + ScrollView

I want to create a layout like first page of android market. I am trying to use gridlayout as I would like to put imageview with different sizes and location, I also need to input scrollview. ...
Marckaraujo's user avatar
  • 7,492
5 votes
2 answers
3k views

What is difference between GridView, GridLayout and Recycler view with GridLayout?

I am developing an app in which i need a layout like provided images. Which layout should i use? and why ? What is difference between GridView and GridLayout ? why they are in legacy section ? What ...
Faisal Imran's user avatar
5 votes
1 answer
10k views

Android margin between buttons in grid layout

I'm trying to create a grid layout containing buttons but by default there is a space between these buttons and I don't need that. The .xml file looks like this: <?xml version="1.0" encoding="utf-...
user avatar
5 votes
1 answer
4k views

Space between GridLayout items

I have a GridLayout in runtime (not a GridView) This is my xml <?xml version="1.0" encoding="utf-8"?> <GridLayout xmlns:android="http://schemas.android.com/apk/res/android" android:...
Boris Karloff's user avatar
5 votes
2 answers
3k views

Android - WrapPanel equivalent

I've read some of WPF/Silverlight controls, and I really liked some of them. One of the panels that I wish Android could have is WrapPanel (as a layout, of course). Has anyone else come across some ...
android developer's user avatar
5 votes
1 answer
2k views

GridLayout pushes down its children and overflow when given fill_parent for height

As it seems the GridLayout will always push its children to layout corresponding to their needs. for instance the following declaration: <?xml version="1.0" encoding="utf-8"?> <GridLayout ...
charroch's user avatar
  • 2,200
4 votes
3 answers
12k views

IntelliJ and android.support.v7.widget.GridLayout

I am running into trouble either setting up the support v7 GridLayout library in my IntelliJ project, or properly referencing it in my code. I currently use the ActionBarSherlock and Facebook ...
PANCAKES's user avatar
  • 361
4 votes
2 answers
10k views

Get BottomSheetBehaviour from BottomSheetDialog

This is my layout for BottomSheetDialog. I've a grid layout inside as well. That grid layout's scrolling is not proper. I mean it scrolls only in expanded state of BottomSheetDialog. <LinearLayout ...
div's user avatar
  • 1,493
4 votes
1 answer
735 views

Grid Layout Width Issue

I have been developing an app for which I also need to handle the UI stuff too. Heres my XML: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="...
Umayr's user avatar
  • 97
4 votes
2 answers
10k views

GridView, GridLayout or TableLayout?

I need to create some screens similar to this one: Also, if the user wants to show more buttons per screen, it would be something like this: Today I am using LinearLayouts to do this. I would like ...
Carlos Pereira's user avatar
4 votes
2 answers
9k views

How GridLayout items come from the Adapter(List/Image) in Android App

Is it possible to Get the GridLayout items from the Adapter in Android. Like, The items in the GridView come from the ListAdapter associated with this view. Please clarify my doubt.. Thanks
Lakshmi Sreekanth Chitla's user avatar
4 votes
2 answers
3k views

Creating a grid like layout in Android

Basically, I have a view that needs to be split up into a 2x4 grid, with each section equal in size (i.e. each row would be 25% of the screen height, and each column would be 50% of the screen width). ...
user avatar
4 votes
1 answer
2k views

android.support.v7.widget.GridLayoutManager$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams

activitymain.xml <android.support.v7.widget.RecyclerView android:background="@color/primary_text" android:layout_marginStart="@dimen/...
Ankur Khandelwal's user avatar
4 votes
1 answer
1k views

GridLayout compatibility - ClassNotFoundException: Didn't find class "android.support.v7.widget.GridLayout"

I'm trying to use GridLayout in my Android 2.2 project, and after having installed the gridlayout_v7 project in my workspace, adding it to my projects Android Dependencies, adding a custom xmlns for ...
saarraz1's user avatar
  • 3,009
4 votes
2 answers
2k views

gridlayout's children visibility gone

This is my .xml. When I touch the cell - visibility sets as View.GONE, but it just disappearing as View.INVISIBLE. There is an empty space in the place when cell was. The size of cells is fixed. How ...
ant's user avatar
  • 407
4 votes
0 answers
2k views

How do I include the Android GridLayout support library in my Android project?

I am trying to add the backwards compatible Gridlayout library to my android project but I can't get it working. And, I have read all other articles on google and on stackoverflow but it still does ...
user2426316's user avatar
  • 7,221
4 votes
2 answers
7k views

Drag and drop items around GridLayout - Android

I have a GridLayout with some items in it. Nothing special on it. I just would like to know if I can drag items around and make the other items automatically arrange themselves. It's like Android ...
Carlos Pereira's user avatar
3 votes
2 answers
4k views

Android GridLayout and EditText

one picture is worth ten thousand words. : ) The right corner is not displayed correctly. Thank you! <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="...
jamalM's user avatar
  • 57

1
2 3 4 5
8