いつもお世話になります。
Android Studio, Mac OS X, Android5.1の組み合わせで開発をしています。
アニメのセル画のように、backgroundに背景の画像(background.jpg)と周囲を透明化した人物の画像(character.png)を表示し、そのうえにEditTextを載せたいと思っています。
下記のソースで、いちおう目的は達成できたのですが、いくつか挙動不明なところがあり、ご相談します。
(1)アニメのセル画のように、backgroundに背景の画像(background.jpg)と人物の画像(character.jpg)を表示するのには、背景に2枚の画像を登録したいが、現在は背景に1枚、上部に1枚、下部にEditTextとなっている。background/character/EditTextを重ねて表示することはできますか? その方法を教えてください。
(2)現状でEditTextをタップすると、characterのimageviewとEditTextが上にずれてキーボードが現れます。keyboardを表示するとき、charcterは移動しない。EditTextのTopは移動せず高さをkeyboard分減らす、というようにしたいです。
方法をご教示ください。
よろしくおねがいします。
ソースの全文は下記の通りです。
activity_main.xml
< ?xml version="1.0" encoding="utf-8"?>
< RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/background"
tools:context=".MainActivity">
<ImageView
android:layout_marginTop="0dp"
android:layout_marginLeft="0dp"
android:id="@+id/character"
android:src="@drawable/character"
/>
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="120dp"
android:layout_marginLeft="5dp"
android:id="@+id/editText"
android:text=""/>
</RelativeLayout>
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2016/02/15 08:58
2016/02/15 09:18
退会済みユーザー
2016/02/16 00:21
2016/02/16 01:15
退会済みユーザー
2016/02/16 04:08
2016/02/16 05:11
退会済みユーザー
2016/02/16 08:55
2016/02/16 09:12
退会済みユーザー
2016/02/17 02:18