气球聊天应用程序问题 [英] Balloon chat application issues

查看:87
本文介绍了气球聊天应用程序问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做一个简单的聊天应用程序,我想告诉气球类似于 iphone 的的短信应用

I am doing a simple chat application and I want to show balloons similar to the iphone's sms app.

所以,我做的活动的ListView 具有一定的布局。 这是我的布局:

So I am doing an Activity with a ListView with a certain layout. This are my layouts:

/* Activity Layout */ 
 <LinearLayout android:orientation="vertical"
       android:layout_width="fill_parent"
       android:layout_height="fill_parent"
    >

     <ListView android:id="@+id/chat_log"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent"
         android:stackFromBottom="true"
         android:layout_marginTop="50dp"
         android:transcriptMode="alwaysScroll"
         android:layout_weight="1"
         android:cacheColorHint="#00000000"
         android:clickable="false"
     />

     <LinearLayout android:orientation="horizontal"
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
     >

   <EditText android:id="@+id/chat_input_text"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_weight="1"
             android:layout_gravity="bottom"
         />

         <Button android:id="@+id/chat_send_button"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="@string/chat_send_button"
         />

     </LinearLayout>
 </LinearLayout>

其他:

/* Row Layout */
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:id="@+id/userprofile_view"
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:background="@drawable/chat_ballon_left" >

 <TextView
  android:id="@+id/chat_message"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:paddingLeft="2dp"
  android:text="haasdasdasdasdasdasdasdoo" />
</FrameLayout>

这里是导致

我的问题:

  • 灰色的线,我想删除。
  • 在不使用整个空间文本。
  • 不知怎的,甚至​​以为我已经添加了机器人:可点击=假气球可以点击
  • The gray line which I would like to remove.
  • Text is not using the whole space.
  • Somehow even thought I've added android:clickable="false" the balloons are clickable.

推荐答案

的FrameLayout 是不必要的,所以使用的TextView作为根元素(当然的chat_ballon_left背景)。宽度设置为 match_parent ,以便文本采取了整个空间。

The FrameLayout is unnecessary, so use the TextView as a root element (with the chat_ballon_left background of course). Set the width to match_parent so that the text takes the whole space.

BTW不错baloons,不要忘了华电国际的版本太:)

BTW nice baloons, don't forget to have hdpi versions too :)

这篇关于气球聊天应用程序问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆