Mahmoud Badri
Mahmoud Badri

Reputation: 1296

Android GridView 1 full width item then 2 columns, how?

I need the first item in my GridView to be twice the size of other items, then all next items to be same size which is half the first item size.

using GridView is not mandatory, it just seems to me it should be done using GridView.

Upvotes: 1

Views: 2066

Answers (3)

r4jiv007
r4jiv007

Reputation: 3104

You should go with GridLayout :-

here is a short tutorial http://developer.samsung.com/android/technical-docs/GridLayout-in-Android

custom arrangement in GridLayout :- Heterogeneous GridLayout

Upvotes: 1

Toon Borgers
Toon Borgers

Reputation: 3658

You can use a linearlayout, set layout_width of all items to 0dp, set layout_weight of the first to 2 and layout_weight of the others to 1

Upvotes: 0

SolArabehety
SolArabehety

Reputation: 8606

You can put the first item out of the gridview in a RelativeLayout

enter image description here

it is not an elegant solution, but it's a solution

Upvotes: 1

Related Questions