2011-03-10 13 views
0

メッセージを送信するための内部のアクティビティを持つアプリケーションの実装を終了します(editTextと2つのボタン - 送信とキャンセル、メッセージは固定アドレスに送信されます)。このアクティビティを開始すると、画面上にテキストボックスとキーボードが表示され、すぐに表示されます。しかし、これの欠点は、ボタンがキーボードで覆われているか半分に覆われていることであり、必要なものはメッセージと同様です。キーボードが見えるときは、テキストフィールドを縮小してキーボード上の追加ボタンに表示します。画面の下に戻る矢印を押すとキーボードが消えます。ほとんどの画面がこのeditTextで撮影され、下に2つのボタンが表示されます...それは本当のことができますか?Android - editTextとsend/exitボタン

編集:この画面にはアクティブなキーボードのすべてのボタンが表示されます。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:orientation="vertical" 
android:layout_height="fill_parent" 
android:background="@drawable/poz3" 
android:padding="10dip"> 
<TextView 
    android:text="Message:" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:textSize="25dip" 
    android:textColor="@color/black" 
/> 
<EditText 
    android:id="@+id/message" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:hint="Write message here" 
    android:gravity="top" 
    android:lines="7" 
    android:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine" 
    android:imeOptions="actionSend|flagNoEnterAction" 
/> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:orientation="horizontal" 
    android:layout_height="fill_parent" 
> 
<Button 
    android:id="@+id/enquirySendButton" 
    android:layout_width="fill_parent" 
    android:layout_height="60dip" 
    android:text="Send" 
    android:layout_weight="1.0" 
    android:background="@drawable/custom_button" 
/> 
<Button 
    android:id="@+id/enquiryExitButton" 
    android:layout_width="fill_parent" 
    android:layout_height="60dip" 
    android:text="Cancel" 
    android:layout_weight="1.0" 
    android:background="@drawable/custom_button" 

    /> 
    </LinearLayout> 
</LinearLayout> 
+0

バディ、あなたが適切に照会し説明してください。 – Mudassir

+0

またはこのリンクはあなたに役立ちますhttp://developer.android.com/resources/articles/on-screen-inputs.html –

+0

xmlを投稿できますか? – ingsaurabh

答えて

1

は作業それを持っています。 XMLレイアウトでは、メインレイアウト(RelativeLayout)にボタンとandroid:layout_alignParentBottom = "true"のLinearLayoutがあります。句のアンドロイドで、下記のお他のレイアウトを追加します。layout_above =「@ ID/yourButtonLayoutは」 私の実際の生活のコードは次のようになります:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"  
android:textSize="14dip" 
> 

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/taskEditFormBottomButtons" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:baselineAligned="true" 
    android:orientation="horizontal"   
    android:layout_alignParentBottom="true" 
>   

    <Button 
     android:id="@+id/taskEditFormBTSave"   
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textStyle="bold" 
     android:text="@string/save" 
     android:layout_weight="0.5"     
    /> 

    <Button 
     android:id="@+id/taskEditFormBTCancel"   
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:textStyle="bold" 
     android:text="@string/cancel" 
     android:layout_weight="0.5"     
    /> 
</LinearLayout> 

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_above="@id/taskEditFormBottomButtons" 
> 

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     .... 
    > 
     .... 
    </RelativeLayout> 
</ScrollView> 
</RelativeLayout> 
+0

あなたの答えをありがとう、私は今それを試してみようとしています – Waypoint

+0

偉大な、ありがとう、私はそれが動作していると驚いている! – Waypoint

0

まだ試していない場合、これは、いくつかの助けになるかもしれません。..

http://developer.android.com/resources/articles/on-screen-inputs.html

+0

editTextに追加されたすべてのものをマニフェストに追加しようとしましたが、それは前と同じです – Waypoint

+0

同じ問題両方の方向(縦と横)で? –

+0

私はちょうど私のアプリで垂直方向を承認しましたが、今それはすでに解決されています – Waypoint