如何开发一个Android手机短信查看? [英] How to develop an android SMS View?
本文介绍了如何开发一个Android手机短信查看?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我要开发Android的一个观点,即类似于撰写短信看法。我并不真正熟悉所有的Android视图元素。
显然,这种看法使用一些文本框。但我想知道的布局都在使用。例如。当用户输入的灰色领域扩大了信息领域的一些文字。
我怎样才能做到这一点,你还能说的这个观点?
解决方案
< XML版本=1.0编码=UTF-8&GT?;
&所述; RelativeLayout的的xmlns:一个=http://schemas.android.com/apk/res/android
答:layout_width =FILL_PARENT
答:layout_height =FILL_PARENT>
<的LinearLayout
答:方向=垂直
答:layout_height =WRAP_CONTENT
答:layout_width =FILL_PARENT>
<的EditText
答:ID =@ + ID / smsRecipients
答:layout_height =WRAP_CONTENT
答:layout_width =FILL_PARENT
答:提示=@字符串/ sms_to_whom/>
<按钮
答:layout_height =WRAP_CONTENT
答:layout_width =FILL_PARENT
答:文本=@字符串/ sms_contacts
一:的onClick =onPickContact/>
< / LinearLayout中>
<的LinearLayout一个:layout_alignParentBottom =真
答:方向=横向
答:layout_width =FILL_PARENT
答:layout_height =WRAP_CONTENT
答:paddingTop =5dip
答:paddingBottom会=5dip
答:以下属性来=5dip
答:paddingRight =5dip
答:后台=#dcdcdc>
<的EditText
答:ID =@ + ID / smsBody
答:layout_width =0dip
答:layout_height =WRAP_CONTENT
答:layout_weight =1.0
答:自动图文集=真
一:利用=句子
答:nextFocusRight =@ + ID / send_button的
答:提示=@字符串/ sms_enter_message
答:MAXLINES =10
答:inputType =textShortMessage | textAutoCorrect | textCapSentences | textMultiLine
答:imeOptions =actionSend | flagNoEnterAction/>
<的LinearLayout一个:方向=垂直一:layout_width =WRAP_CONTENT一:layout_height =FILL_PARENT>
<按钮
答:ID =@ + ID / smsSendButton
答:layout_marginLeft =5dip
答:layout_width =WRAP_CONTENT
答:layout_height =0dip
答:layout_weight =1.0
答:nextFocusLeft =@ + ID / smsBody
答:文本=@字符串/ sms_send_abbr
一:启用=FALSE/>
< / LinearLayout中>
< / LinearLayout中>
< / RelativeLayout的>
I want to develop a view in android that is similar to the compose SMS view. I am not really familiar with all android view elements.
It is obvious that this view uses some textfields. But I want to know what layouts are in use. E.g. when the user enters some text in the message field the Grey field expands.
How can I achieve this and what else can you say about this view?
解决方案
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:a="http://schemas.android.com/apk/res/android"
a:layout_width="fill_parent"
a:layout_height="fill_parent">
<LinearLayout
a:orientation="vertical"
a:layout_height="wrap_content"
a:layout_width="fill_parent">
<EditText
a:id="@+id/smsRecipients"
a:layout_height="wrap_content"
a:layout_width="fill_parent"
a:hint="@string/sms_to_whom"/>
<Button
a:layout_height="wrap_content"
a:layout_width="fill_parent"
a:text="@string/sms_contacts"
a:onClick="onPickContact"/>
</LinearLayout>
<LinearLayout a:layout_alignParentBottom="true"
a:orientation="horizontal"
a:layout_width="fill_parent"
a:layout_height="wrap_content"
a:paddingTop="5dip"
a:paddingBottom="5dip"
a:paddingLeft="5dip"
a:paddingRight="5dip"
a:background="#dcdcdc">
<EditText
a:id="@+id/smsBody"
a:layout_width="0dip"
a:layout_height="wrap_content"
a:layout_weight="1.0"
a:autoText="true"
a:capitalize="sentences"
a:nextFocusRight="@+id/send_button"
a:hint="@string/sms_enter_message"
a:maxLines="10"
a:inputType="textShortMessage|textAutoCorrect|textCapSentences|textMultiLine"
a:imeOptions="actionSend|flagNoEnterAction"/>
<LinearLayout a:orientation="vertical" a:layout_width="wrap_content" a:layout_height="fill_parent">
<Button
a:id="@+id/smsSendButton"
a:layout_marginLeft="5dip"
a:layout_width="wrap_content"
a:layout_height="0dip"
a:layout_weight="1.0"
a:nextFocusLeft="@+id/smsBody"
a:text="@string/sms_send_abbr"
a:enabled="false"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
这篇关于如何开发一个Android手机短信查看?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文