<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ScrollView
android:id="@+id/ScrollView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/LinearLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<!-- 追加したいViewを追加する スクロールが必要な時、出力される -->
</LinearLayout>
</ScrollView>
</LinearLayout>
中央のみ以下を設定
android:layout_weight=”1″
その他のレイアウトのときは、LinerLayout に入れて中央のみ layout_weigt=”1″ 指定する
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:text="上側固定"
android:gravity="center_horizontal"/>
<ListView
android:id="@+id/listView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
>
</ListView>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="下側固定" />
</LinearLayout>
<TextView
android:id="@+id/text_category_id"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:gravity="right"
/>
上記でTextView 枠の中で右基準になる。
layout_width が wrap_content だと あまり意味がない
TextView の位置を変えるには、
android:layout_gravity だよ
テーブルの項目名に日本語を使用
とりあえず動いた
CREATE TABLE [T_カテゴリ] ([ID] INTEGER NOT NULL,
[NO] INTEGER DEFAULT ‘0’,
[出題対象] VARCHAR(2) NOT NULL,
[カテゴリID] INTEGER DEFAULT ‘0’ UNIQUE,
[カテゴリ名] VARCHAR(50),
[問題数] INTEGER DEFAULT ‘0’,
[出題数] INTEGER DEFAULT ‘0’,
[正解率(英和)] INTEGER DEFAULT ‘0’,
[正解率(和英)] INTEGER DEFAULT ‘0’,
[正解率(スペル)] INTEGER DEFAULT ‘0’,
[表示許可] VARCHAR(2) NOT NULL,
[レベル] INTEGER DEFAULT ‘0’,
[学習日付] VARCHAR(15),
PRIMARY KEY(ID)
);
がっ、以下のメソッドは”[]”は不要
mCursor.getColumnIndex(“カテゴリID”)
すでに jp.hoge.boke がある
指定したパッケージ jp.hoge
書き込みが出来なくてエラーとなる
小一時間、はまる(^_^;)