android-gridlayout

Create gridlayout. [closed]

两盒软妹~` 提交于 2019-12-13 08:27:15
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I need to create a layout like this: , I'm trying to do this using gridlayout, but it I cannot find the correct method. Can anyone please give me some guidance? Thanks! 回答1: I guess that the most straightforward way is combining horizontal and vertical LinearLayouts , setting different weights to its subviews.

Expand an image in gridview when clicked in Android

可紊 提交于 2019-12-13 07:43:19
问题 I am implementing a GridView which contains images. I want to expand an image to occupy the whole row when it's clicked as shown in the images below. I also want to show a button when the image is expanded so the user can take an action similar to how the ESPN app does that. How can I achieve this? ----> 回答1: Surround your layout with a relative layout. Create a layout and a button inside it outside grid layout/inside relative layout. Set it's initial visibility to gone and match it's height,

Import Android “Gridlayout library project” directly into my project

梦想与她 提交于 2019-12-13 04:47:40
问题 i already found out how to use the Gridlayout for Android 4.0 Devices. I downloaded the support library, imported it as a library project and then i referenced it as a library in my own project. But i want to have the library directly in my own project. I already copied the files of the libs folder in my own libs folder. And i also copied the attrs.xml and dimens.xml into my own project. Then i added both jar files to my build-path. Eclipse itself gives me no error, but the Android layout

Is GridLayout supported by proteus? If not then what is an alternative?

早过忘川 提交于 2019-12-13 03:45:14
问题 I'm trying to use GridLayout in json like this { "type": "GridLayout", "android": "http://schemas.android.com/apk/res/android", "orientation": "horizontal", "layout_width": "match_parent", "layout_height": "match_parent", "columnCount": "2", "rowCount": "2", "children": [ { "type": "TextView", "layout_width": "wrap_content", "layout_height": "wrap_content", "layout_columnWeight": "1", "layout_marginTop": "8dp", "layout_marginLeft": "16dp", "textSize": "20dp", "textColor": "@android:color

i want grid view with loading by scroll i have image fetch from sever but i want only 10 images view other can load when scrolling grid view

瘦欲@ 提交于 2019-12-12 10:27:30
问题 public class NewMovie extends Activity { GridView lv; Vibrator vibrator; SimpleAdapter adapter; Button b; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); Log.i("Category", MainActivity.movie_Category); setContentView(R.layout.new_movie); vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); lv = (GridView) findViewById(R.id.grid_view); // URL to the JSON data String strUrl = "http://vaibhavtech

Variable number of columns in GridLayoutManager

痞子三分冷 提交于 2019-12-12 07:47:17
问题 I wanted to display variable number of columns in a row of GridLayoutManager while using RecyclerView. The number of columns to be displayed depends on the size of the column's TextView. I don't know the column width as the text is being dynamically put in it. Can anyone help? StaggeredGridLayoutManager is not solving my purpose as it customizes the height but takes fixed number of columns. 回答1: Take a look at the setSpanSizeLookup method of the GridLayoutManager . It lets you specify the

Dynamically generated buttons don't occupy even space in GridLayout

不问归期 提交于 2019-12-12 03:51:08
问题 I have a GridLayout in which I want Buttons to be generated dynamically. I have specified the number of rows & columns of the GridLayout in XML. I want the generated buttons to occupy even amount of space in the GridLayout . That is to say, if I have three columns, all three buttons should occupy same space. Now I have seen a few examples here on StackOverflow that suggest making use of android:layout_width , but none of them contain examples of dynamically generated Views & I don't know if

Set ColumnSpan and ColumnWeight programmatically

ⅰ亾dé卋堺 提交于 2019-12-12 02:57:42
问题 I have been trying to add views to a gridLayout, wich I have done, but they're not adjusting to the columns as they should, I had tried inflate the views with the same atribute that is showing well in XML but had no success. Now, I am trying to create the views programatically but it isn't working, how can I achive what I want? Relevant Code: This is my GridLayout <android.support.v7.widget.GridLayout android:id="@+id/grd_team_a" android:layout_width="match_parent" android:layout_height="wrap

How to make GridLayoutManager use dynamic spaces? [duplicate]

痴心易碎 提交于 2019-12-11 18:55:53
问题 This question already has answers here : Different (dynamic) items height in GridLayoutManager (2 answers) Closed 8 months ago . I am currently using a GridLayoutManager for a RecyclerView which displays Previews of different Articles, which have different text lengths and therefor different item heights. The question is, how can I use the full height and dont have too much spacing? 回答1: Use StaggeredGridLayoutManager! https://developer.android.com/reference/android/support/v7/widget

How to set Staggered grid layout in different screen dimensions.?

会有一股神秘感。 提交于 2019-12-11 13:11:46
问题 I am using staggered grid layout manager to set staggered grid in my app,I have used Imageview inside "card view".The staggered effect is working properly ,but some cases when image size is too large,then the layout will be like this [![enter image description here][1]][1] my xml file <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/card_view" android:layout_width="220dp"