android-gridlayout

Android: GridLayout spacing between items

烈酒焚心 提交于 2019-12-01 14:38:42
问题 I have a grid layout which is filled with buttons, now i want the buttons to be more distant from each other, what code should i write? i tried to search it but only found a solution for GridView, not GridLayout. 回答1: You can put margin to the buttons 回答2: Instead of adding margin to each buttons, use android:useDefaultMargins="true" It is better than adding margin to each buttons! 来源: https://stackoverflow.com/questions/35270404/android-gridlayout-spacing-between-items

Obfuscate android.support.v7.widget.GridLayout issue

左心房为你撑大大i 提交于 2019-12-01 08:39:37
I'm trying to obfuscate my android application, where I use android.support.v7.appcompat and android.support.v7.GridLayout, but the app is crashing with the following exception: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.v7.widget.GridLayout at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698) at android.view.LayoutInflater.inflate(LayoutInflater.java:466) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at com.droid.fragments.c.al.onCreateView(Unknown Source) at android.support.v4.app.Fragment

Eclipse and Android SL GridLayout not working together - “android.support.v7.widget.GridLayout could not be instantiated”

笑着哭i 提交于 2019-12-01 08:16:02
问题 I'm new to Android development, so it's possible this is a simple question. Apologies if it is - I spent quite some time searching but couldn't find anything that worked. I'm trying to use a GridLayout in my project, but ideally with the Android Support Library so I can target lower versions of the API. When I drag a GridLayout into the graphical layout designer, a message pops up asking explaining I need a compatibility library for API versions older than 14, and asks if I want to install

How to make span count and icon size automatic

不打扰是莪最后的温柔 提交于 2019-12-01 01:42:30
I am using recycler view with card view to show icons in my application. I am not able to figure out how to resize the app icons and increase/decrease the span count automatically depending on the screen size. Here is what I am doing to display it and the spen count is fixed to 3. RecyclerView mrv = (RecyclerView) findViewById(R.id.recyclerview_id); RecyclerViewAdapter myAdapter = new RecyclerViewAdapter(this, lsStore); mrv.setLayoutManager(new GridLayoutManager(this, 3)); mrv.setAdapter(myAdapter); The XMLs are below <?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.CardView

EditText getting out of GridLayout

眉间皱痕 提交于 2019-11-30 15:58:39
I am trying to create a view with an EditText and a label associated. I am placing them in a GridLayout. The EditText is in the last column and the text seems to go out of the screen. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="mobi.designmyapp.osmtemplate.note.NoteActivity" android:orientation="vertical"> <GridLayout android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="2" android:rowCount="1

EditText getting out of GridLayout

偶尔善良 提交于 2019-11-29 15:08:21
问题 I am trying to create a view with an EditText and a label associated. I am placing them in a GridLayout. The EditText is in the last column and the text seems to go out of the screen. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="mobi.designmyapp.osmtemplate.note.NoteActivity" android:orientation="vertical"> <GridLayout android

How can i get Vertical scrolling in GridView android?

久未见 提交于 2019-11-29 14:53:21
I am developing an android application with showing images. I am using grid view to show the images in my application. But default gridview is horizontal scrolling I want to show the images in vertical scrolling grid view. Please suggest me a way to achieve vertical scrolling in gridview. Thanks in advance. Use android:numColumns="3" // this will force gridview to have 3 columns and if you have more than 3 items in grid view, you can have vertical scrolling. Ex.: <GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridView1" android:numColumns="3" android

Android GridLayout API 21

霸气de小男生 提交于 2019-11-29 07:18:35
I'm trying to accomplish something like this: Currently, I'm manually setting the width of the tiles equal to half the screen width. This works well, but it makes adding dividers between the tiles (as seen in the screenshot) hard. Luckily, it seems that in API 21, there is now support for weight in GridLayout , quoted here for your convenience: As of API 21, GridLayout's distribution of excess space accomodates the principle of weight. In the event that no weights are specified, the previous conventions are respected and columns and rows are taken as flexible if their views specify some form

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

╄→尐↘猪︶ㄣ 提交于 2019-11-29 02:59:41
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 application available to older version of android as well, I tried to use Android's own Support Library GridLayout which adds support up to API 7. This was exactly what I was looking for, however I cannot for the life of me get it to work. I have tried all of these explanations and ideas: Android's official instructions Solution 1 Solution 2 Solution 3 Solution 4 Solution 5 and more... No matter what I do,

How to support `layout_columnWeight` and `layout_rowWeight` in pre API 21?

帅比萌擦擦* 提交于 2019-11-28 13:18:33
I use the below grid layout with layout_columnWeight and layout_rowWeight to centralize my view in the grid cell. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" > <GridLayout android:id="@+id/container_grid" android:layout_width="match_parent" android:layout_height="match_parent" android:columnCount="2" android:rowCount="3" android:orientation="horizontal"> <View android:id="@