Я пишу приложение для Android, и в нем я хочу иметь своего рода строку заголовка, включающую название игры, счет и тому подобное.Затем, ниже, я хочу иметь сетку изображений, которая будет похожа на плитки, на которых я могу отображать разных персонажей в моей игре.
У меня есть следующий макет xml, но когда я его запускаю иЯ получаю черный экран:
</p>
<pre><code><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/app_name"
/>
<TextView android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/score"
/>
<TextView android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="0"
/>
<TextView android:id="@+id/robotsLeft"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="@string/robots"
/>
<TextView android:id="@+id/score"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="0"
/>
</LinearLayout>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:columnWidth="90dp"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:stretchMode="columnWidth"
android:gravity="center"
/>
GridView инициализируется в соответствии с данным руководством:
http://developer.android.com/resources/tutorials/views/hello-gridview.html
т.в основном занятии onCreate ():
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
Может кто-нибудь увидеть что-то, что я сделал неправильно?
Спасибо!