« 画面の向きを指定する 文字の色を変更する »
背景画像を加える。
2011年2月4日(金) 5:17 PM
アプリの背景に画像を設定するには、
resフォルダにdrawableフォルダを作成し、その中にbg.pngを入れる。
そのあと、AndroidManifest.xmlに
android:background=”@drawable/bg”を
加えると、表示されます。
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/bg" > <Button android:id="@+id/myButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="次のActivityへ" /> </LinearLayout>
その他のコードは、Intentを使って、Activityを呼び出す
と同じです。
Tag:
« 画面の向きを指定する 文字の色を変更する »
コメントの更新情報
トラックバックURL
https://appli-info.jp/2011/02/04/%e8%83%8c%e6%99%af%e7%94%bb%e5%83%8f%e3%82%92%e5%8a%a0%e3%81%88%e3%82%8b%e3%80%82/trackback/