Add a textView after a gridView

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Add a textView after a gridView

Postby nah0y » Mon Feb 02, 2009 6:47 pm

Hi guys !

I'm coming to you with another problem,

I'm trying to create a game, and i'm using a grid view, but i want to add a textView, here is my XML file :
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3.  
  4.  
  5. <GridView xmlns:android="http://schemas.android.com/apk/res/android"
  6.  
  7.    android:id="@+id/myGrid"
  8.  
  9.    android:layout_width="fill_parent"
  10.  
  11.    android:layout_height="fill_parent"
  12.  
  13.    android:padding="10dp"
  14.  
  15.    android:verticalSpacing="10dp"
  16.  
  17.  
  18.  
  19.    android:horizontalSpacing="10dp"
  20.  
  21.    android:numColumns="auto_fit"
  22.  
  23.    android:columnWidth="60dp"
  24.  
  25.    android:stretchMode="columnWidth"
  26.  
  27.  
  28.  
  29.    android:gravity="center"
  30.  
  31.    />
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


If i want to add a textView, i would do like that :
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <LinearView xmlns:android="http://schemas.android.com/apk/res/android">
  4.  
  5. <GridView
  6.  
  7.    android:id="@+id/myGrid"
  8.  
  9.    android:layout_width="fill_parent"
  10.  
  11.    android:layout_height="fill_parent"
  12.  
  13.    android:padding="10dp"
  14.  
  15.    android:verticalSpacing="10dp"
  16.  
  17.  
  18.  
  19.    android:horizontalSpacing="10dp"
  20.  
  21.    android:numColumns="auto_fit"
  22.  
  23.    android:columnWidth="60dp"
  24.  
  25.    android:stretchMode="columnWidth"
  26.  
  27.  
  28.  
  29.    android:gravity="center"
  30.  
  31.    />
  32.  
  33. <TextView
  34.  
  35.  android:layout_width="fill_parent"
  36.  
  37.  android:layout_height="fill_parent"/>
  38.  
  39. </LinearView>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


But when i launch the application, i have a "Force close".

Help ? :roll:
nah0y
Developer
Developer
 
Posts: 30
Joined: Mon Jan 12, 2009 10:59 pm

Top

Postby MrSnowflake » Mon Feb 02, 2009 7:03 pm

Find out what the force close caused! Check you log.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby nah0y » Mon Feb 02, 2009 7:09 pm

Code: Select all
!ENTRY com.android.ide.eclipse.editors 2 0 2009-02-02 19:09:12.726
!MESSAGE AndroidManifest: Ignoring unknown 'LinearView' XML element

[align=center] :shock:[/align]
nah0y
Developer
Developer
 
Posts: 30
Joined: Mon Jan 12, 2009 10:59 pm

Postby MrSnowflake » Mon Feb 02, 2009 8:38 pm

You might try using LinearLayout and giving it some attributes.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Postby nah0y » Mon Feb 02, 2009 8:44 pm

I have changed LinearView to LinearLayout (in fact, i'd never used LinearView, i just type it when i was writting this post... sry...) and still the same problem.

And nothing in the log file (PS : The log file is accessible via : Windows -> Show View -> Error log isn't it ?)

Thx.
nah0y
Developer
Developer
 
Posts: 30
Joined: Mon Jan 12, 2009 10:59 pm

Postby MrSnowflake » Mon Feb 02, 2009 9:08 pm

You have the gridview set to fill parent vertically, so it occupies all visible space in the linlayout. Make it wrap_content on vertical.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Postby nah0y » Mon Feb 02, 2009 9:10 pm

Still got the error... :cry:
nah0y
Developer
Developer
 
Posts: 30
Joined: Mon Jan 12, 2009 10:59 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests