Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2577002
  • 博文数量: 315
  • 博客积分: 3901
  • 博客等级: 少校
  • 技术积分: 3640
  • 用 户 组: 普通用户
  • 注册时间: 2011-05-08 15:32
个人简介

知乎:https://www.zhihu.com/people/monkey.d.luffy Android高级开发交流群2: 752871516

文章分类

全部博文(315)

文章存档

2019年(2)

2018年(1)

2016年(7)

2015年(32)

2014年(39)

2013年(109)

2012年(81)

2011年(44)

分类: Android平台

2013-06-02 22:46:13

    这里在原来的基础上给EditText和Button添加了背景图片和设置了下边框离屏幕左、上、右、下的距离;由于找不到更好的图片,就将就了,至少比之前效果好点;至于离屏幕边框距离的设置只是简单的填写了dp的值,并没有根据屏幕的分辨率什么的计算,这个可以计算的。以后慢慢熟悉了,有时间了再说吧,明天还上班了了!!!
    布局代码修改如下【挺不专业的,感谢网友】:

点击(此处)折叠或打开

  1. <LinearLayout xmlns:android=""
  2.     android:layout_width="fill_parent"
  3.     android:layout_height="fill_parent"
  4.     android:orientation="vertical" >

  5.     <!--
  6.          <TextView
  7.         android:layout_width="fill_parent"
  8.         android:layout_height="wrap_content"
  9.         android:text="@string/hello_world" />
  10.     -->

  11.     <TextView
  12.         android:layout_width="fill_parent"
  13.         android:layout_height="wrap_content"
  14.         android:text="@string/height" />

  15.     <!-- android:hint是输入提示 -->
  16.     <EditText
  17.         android:id="@+id/height"
  18.         android:layout_width="fill_parent"
  19.         android:layout_height="wrap_content"
  20.         android:padding="7dp"
  21.         
  22.         android:shadowColor="#ff000000"
  23.         android:shadowDx="2"
  24.         android:shadowDy="2"
  25.         android:shadowRadius="1"
  26.            
  27.         android:layout_marginLeft="5dp"
  28.         android:layout_marginTop="5dp"
  29.         android:layout_marginRight="5dp"
  30.         android:layout_marginBottom="5dp"
  31.         
  32.         android:background="@drawable/edit_text"
  33.         android:hint="@string/bmi_height_tip"
  34.         android:inputType="number"
  35.         android:text="" />

  36.     <TextView
  37.         android:layout_width="fill_parent"
  38.         android:layout_height="wrap_content"
  39.         android:text="@string/weight" />

  40.     <!-- android:inputType替代了android:numeric="integer"消除了警告 -->
  41.     <EditText
  42.         android:id="@+id/weight"
  43.         android:layout_width="fill_parent"
  44.         android:layout_height="wrap_content"
  45.         android:padding="7dp"
  46.         
  47.         android:shadowColor="#ff000000"
  48.         android:shadowDx="2"
  49.         android:shadowDy="2"
  50.         android:shadowRadius="1"
  51.            
  52.         android:layout_marginLeft="5dp"
  53.         android:layout_marginTop="5dp"
  54.         android:layout_marginRight="5dp"
  55.         android:layout_marginBottom="10dp"
  56.            
  57.         android:background="@drawable/edit_text"
  58.         android:hint="@string/bmi_weight_tip"
  59.         android:inputType="number"
  60.         android:text="" />

  61.     <Button
  62.         android:id="@+id/submit"
  63.         android:layout_width="fill_parent"
  64.         android:layout_height="wrap_content"
  65.         
  66.         android:layout_marginLeft="5dp"
  67.         android:layout_marginRight="5dp"
  68.         
  69.         android:background="@drawable/button_on"
  70.         android:text="@string/bmi_btn" />

  71.     <TextView
  72.         android:id="@+id/result"
  73.         android:layout_width="fill_parent"
  74.         android:layout_height="wrap_content"
  75.         android:text="" />

  76.     <TextView
  77.         android:id="@+id/suggest"
  78.         android:layout_width="fill_parent"
  79.         android:layout_height="wrap_content"
  80.         android:text="" />

  81. </LinearLayout>
    效果好点【阴影可以去掉】:
                                         
  背景在这里......后续继续完善,还有就是按钮各种事件的修改,如果我是美工就好了...

阅读(3580) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~