layout_width="wrap_parent" in GridView does not work as I expect

by Mark Murphy » Fri, 26 Sep 2008 13:21:37 GMT


Sponsored Links
 


Possibly by default android:stretchMode behaves as "AUTO_FIT".

Try android:stretchMode="NO_STRETCH", or possibly android:stretchMode=" 
STRETCH_COLUMN_WIDTH" or "STRETCH_SPACING", in your layout XML for your 
GridView, to see if one of those settings is more to your liking.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
Warescription: All titles, revisions, & ebook formats, just $35/year

--~--~---------~--~----~------------~-------~--~----~



layout_width="wrap_parent" in GridView does not work as I expect

by Kah0ona » Fri, 26 Sep 2008 13:28:19 GMT


 Hello,

Not entirely sure if such questions belong here, but anyways.

I have a simple main.xml file with a GridView inside a LinearLayout
(orientation=vertical). The GridView has numColumns specified at 3 and
there are exactly 9 objects in the grid, creating a 3x3 matrix, where
each columnWidth is fixed at 30dp. Both layout_height and _width are
specified as "wrap_content".

Under the gridview is a simple TextView with a hardcoded string in it.

Now on the bottom this wrap_content works; i can tell by putting a
different background color, to see the edges of the gridview. But on
the right side, it fills up to fill the screen, as if fill_parent was
specified! What am I doing wrong here? What is the reason that it
doesn't wrap the content horizontally, but it DOES vertically?

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


layout_width="wrap_parent" in GridView does not work as I expect

by Kah0ona » Fri, 26 Sep 2008 17:31:52 GMT


 hm that didn't work... I kind of refuse to use a hardcoded width,
which works, but is sub-optimal...

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Create "always running" app

Is it possible to create an app which always runs in the background
and can "listen" to user input?
To be more specific, is it possible to open your app by performing a
gesture or long pressing selected text on any screen in any other
running app?

--~--~---------~--~----~------------~-------~--~----~

2. Notalgila Android OHD

Awalnya krn bosen make Javelin trs ada duit dikit, rasanya waktu itu pgn balik 
ke iPhone, jadi targetnya setelah baca2 pilihan jatuh ke Palm Pre, Htc Hero 
atau 3g (3gs belom kluar)..

Palm pre trnyata di lock ke sprint, 3g nanggung krn 3gs mo keluar, htc hero jg 
susah nyarinya..ternyata Magic dah ada di indo, baca2 systemnya buka2 xda 
developer..wah nampaknya magic bisa ditanam hero..akhirnya diputuskan ambil 
magic, 6,5 juta saja..jiahahahahaha...

Belom tau masalah OHD dan GMS nih..pas barang nyampe di tangan duh 
senengnya..cantik..

Sejam, 2 jam otak atik, mo install app gmana yah..google search..crooot katanya 
pake market, cari2 loh kok ga ada marketnya? Cari tau ttg market di android, 
semua site saat itu bilang pasti ada di android, loh kok magic gw ga ada? 
Telepon yg jual, katanya login dolo ke google..lah gmana mo loginnya? Di 
setting kali ada pilihannya..oprek settingan tetep ga nemu..lah trnyata yg 
jualnya jg oon..gubrak!!

Baca di sitenya htc pun ga jelas, disebut disana ada google service, htc indo 
ini loh..akhirnya masuk ke support htc trs email htc..baru dah jelas masalah 
OHD dan GMS ini..alamaak...

Google lebih dalam ttg OHD dan GMS, obrak abrik di xda developer cari tau ttg 
install rom..eng ing eng..trnyata SpL Magic gw a "dreaded perfected Spl" yg 
artinya ga bisa di oprek klo ada update rom mesti pake rom resmi dari htc..

Ya dah nyerah..pake android seadanya..berburu file apk buat install manual dari 
sdcard, sialnya banyak app yg tergantung dgn google service..jadi ga bisa di 
install di magic, contoh palringo dan tunewiki, trs app yg free di market 
hampir impossible dicari..krn orang pada umumnya mikir kan tinggal download aja 
dari market, banyak yg ga tau masalah OHD dan GMS ini..padahal banyak app yg 
bagus2 dan free di Market..

SlideMe, AndAppStore dan handango? Sedikit bener app nya saat itu..app yg 
bagus2 dan free hampir ga ada..bahkan gw sempet email2an sama developer 
tunewiki, ngejelasin kalo appnya tunewiki ga bisa di install di magic gw yg 
OHD, ampe keder dia..trs akhir dia minta cek lognya..dan gw liat app tunewiki 
depends on gmaps API untuk set location and social networkingnya..krn magic gw 
non google ya ga nemu gmaps api ini..sampe akhirnya tunewiki ngebuat app yg ga 
depends lagi ke gmaps api, lucunya mereka nanya.."tau ga app yg sejenis 
market?" Jiahahahahhs...bayangkan bahkan developer sekaliber tunewiki yg appnya 
dah tersedia buat iphone dan bb aja taunya cuma Android market..gubrak bener 
dah..pantesan ebuddy, palringo, babbler dll pada ga ada di SlideMe, cuma 
sedikit appnya

Sebulan lebih berlalu, nemu 2-3 orang yg sepenanggungan ma gw..ampe pada mo 
jual magic..wakakakakaka...

Dan ternyata diluar negeri sana jg banyak yg ngomel2 ttg OHD ini, salah satunya 
yg gw liat di xda dari AirTell india...

Sampe ada salah satu user xda id ekindagen (sorry kalo salah eja) dapat bocoran 
file ruu dari singapur dan ruu buat asia yg mematikan kode security SpL..
Dgn 2 modal file ruu akhirnya magic bisa dirubah jadi non perfected spl dan 
pake engineering spl..

Akhirnya Android gw MERDEKA!!!
Bebas mo diapain..ya tentu dgn resiko yg gw tanggung sendiri..jiahahahaha...

Sampe akhirnya skr dah ada program2 automatic buat rooting..maknyooos...

Btw ekindagen itu org indo loh..

Viva Open Source
Viva Merdekaaaaa...

Jiahahahahahaha...

Sekian nostalgilanya..kalo ada salah kata mohon maaf..



--- Sent with SEVEN on Android - the new generation of mobile messaging

--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group, please visit the following page:
 

3. Remote erase

4. Cara beli apps di market

5. run Android app on iPhone

6. MapsDemo sample app mysterious menu

7. Cara besarin font email