Android编程实现圆角边框布局效果的方法-创新互联

本文实例讲述了Android编程实现圆角边框布局效果的方法。分享给大家供大家参考,具体如下:

成都创新互联专注于资源企业网站建设,响应式网站设计,商城网站定制开发。资源网站建设公司,为资源等地区提供建站服务。全流程按需制作网站,专业设计,全程项目跟踪,成都创新互联专业和态度为您提供的服务

这里用的是TableLayout布局的。先看效果图

Android编程实现圆角边框布局效果的方法

下面看下布局文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:Android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:background="#FFFFFF"
  android:orientation="vertical" >
  <!-- 表格布局 -->
  <TableLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10dip" >
    <!-- 表格布局:第一行 -->
    <TableRow
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/shape_top_corner_no_bottom_line"
      android:padding="10dip" >
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginRight="10dip"
        android:text="姓名:" >
      </TextView>
      <EditText
        android:id="@+id/bankingYourNameEditText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:background="@null"
        android:singleLine="true" >
      </EditText>
    </TableRow>
    <!-- 表格布局:第二行 -->
    <TableRow
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/shape_no_corner_without_bottom"
      android:padding="10dip" >
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginRight="10dip"
        android:text="联系电话:" >
      </TextView>
      <EditText
        android:id="@+id/bankingContactTelEditText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:background="@null"
        android:inputType="phone"
        android:singleLine="true" >
      </EditText>
    </TableRow>
    <!-- 表格布局:第三行 -->
    <TableRow
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/shape_bottom_corner_no_top_line"
      android:padding="10dip" >
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginRight="10dip"
        android:text="联系电话:" >
      </TextView>
      <EditText
        android:id="@+id/bankingContactTelEditText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_weight="1"
        android:background="@null"
        android:inputType="phone"
        android:singleLine="true" >
      </EditText>
    </TableRow>
  </TableLayout>
  <Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center"
    android:text="Button" />
</LinearLayout>

名称栏目:Android编程实现圆角边框布局效果的方法-创新互联
当前网址:https://www.cdcxhl.com/article0/jsjio.html

成都网站建设公司_创新互联,为您提供网站收录网站排名做网站移动网站建设动态网站小程序开发

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都网页设计公司