退会済みユーザー
2015/10/31 18:18 投稿
チャットアプリのレイアウトについて |
###実現したいこと |
現在、WhatAppなどのチャットアプリの作成にチャレンジしています。 |
今、ユーザーとのチャット部分を作っているのですが、レイアウトで躓いています。 |
現在のレイアウトが下記の画像です。 |
問題なのは、メッセージ入力部分とリストビューの文字がかぶってしまっていて見栄えがとても悪い状態です。 |
問題なのは、メッセージ入力部分とリストビューとかぶってしまっていて見栄えがとても悪い状態です。 |
色々やってみたのですが、解決できませんでした。 |
どなたかお力を貸していただけないでしょうか? |
 |
###ソースコード |
```xml |
<?xml version="1.0" encoding="utf-8"?> |
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" |
xmlns:app="http://schemas.android.com/apk/res-auto" |
xmlns:tools="http://schemas.android.com/tools" |
android:layout_width="match_parent" |
android:layout_height="match_parent" |
android:fitsSystemWindows="true" |
tools:context=""> |
<android.support.design.widget.AppBarLayout |
android:layout_width="match_parent" |
android:layout_height="wrap_content" |
android:theme="@style/AppTheme.AppBarOverlay"> |
<android.support.v7.widget.Toolbar |
android:id="@+id/toolbar" |
android:layout_width="match_parent" |
android:layout_height="?attr/actionBarSize" |
android:background="?attr/colorPrimary" |
app:popupTheme="@style/AppTheme.PopupOverlay" /> |
</android.support.design.widget.AppBarLayout> |
<include layout="@layout/content_chat" /> |
<android.support.design.widget.TextInputLayout |
android:id="@+id/text_input_layout" |
android:layout_width="300sp" |
android:layout_height="wrap_content" |
android:layout_gravity="bottom|start" |
android:layout_marginBottom="10sp" |
android:layout_marginStart="10sp"> |
<EditText |
android:layout_width="match_parent" |
android:layout_height="wrap_content" /> |
</android.support.design.widget.TextInputLayout> |
<android.support.design.widget.FloatingActionButton |
android:id="@+id/fab" |
android:layout_width="wrap_content" |
android:layout_height="wrap_content" |
android:layout_gravity="bottom|end" |
android:layout_margin="@dimen/fab_margin" |
android:src="@drawable/ic_send_white_24dp" /> |
</android.support.design.widget.CoordinatorLayout> |
``` |
```xml |
<?xml version="1.0" encoding="utf-8"?> |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |
xmlns:app="http://schemas.android.com/apk/res-auto" |
xmlns:tools="http://schemas.android.com/tools" |
android:layout_width="match_parent" |
android:layout_height="match_parent" |
android:paddingBottom="@dimen/activity_vertical_margin" |
android:paddingLeft="@dimen/activity_horizontal_margin" |
android:paddingRight="@dimen/activity_horizontal_margin" |
android:paddingTop="@dimen/activity_vertical_margin" |
app:layout_behavior="@string/appbar_scrolling_view_behavior" |
tools:context="si.q2.intrachat.ChatActivity" |
tools:showIn="@layout/activity_chat"> |
<ListView |
android:id="@+id/listView" |
android:layout_width="wrap_content" |
android:layout_height="wrap_content" /> |
</RelativeLayout> |
``` |