XML Relative Layout Demo

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
     android:id="@+id/container"
     android:layout_width="match_parent"
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_height="match_parent"
     android:orientation="vertical"
     android:paddingBottom="10dp"
     android:paddingLeft="10dp"
     android:paddingTop="20dp"
     android:background="#003399"
     >
     <TextView
             android:id="@+id/tv1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:text="TypeHere:"
             android:textSize="22sp"

             android:textColor="#FFFFFF"
             />
     <RelativeLayout
         android:id="@+id/rl1"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"

         >
         <EditText
             android:id="@+id/te1"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:paddingLeft="20dp"
             android:paddingRight="20dp"
             android:paddingTop="15dp"
             android:ems="20"
             android:layout_marginTop="8dp"
             android:layout_marginRight="20dp"
             android:background="#FFFFFF"
             android:lines="10"
             android:gravity="top"
             android:hint="Content"
             />

       <Button
           android:id="@+id/bcan"
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"
           android:layout_below="@id/te1"
           android:layout_alignRight="@id/te1"
           android:layout_marginTop="10dp"
           android:text="Cancel"

           />
        <Button
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/bsend"
            android:text=" Send "
            android:layout_toLeftOf="@id/bcan"
            android:layout_below="@id/te1"
            android:layout_alignTop="@id/bcan"

            />
     </RelativeLayout>

</LinearLayout>

XML Relative Layout Demo

时间: 2024-07-29 21:07:37

XML Relative Layout Demo的相关文章

XML liner layout demo

<?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:paddi

Android -如何在底部左对齐,中对齐,右对齐三个按钮图片 巧用Relative Layout

Relative Layout 不仅可以指定同级的元素之间的位置关系(e.g. layout_toLeftOf) 还可以指定子元素与父元素之间的位置关系(e.g. layout_alignParentLeft 相对于父元素左对齐) 利用这一点,可以轻松实现图片在屏幕底部对齐显示. 代码如下: <?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://

android升级SDK后,XML graphical layout无法预览的解决

本人升级SDK后,以前项目的所有XML在graphical layout都无法预览了,觉得有点纳闷,就网上搜了一下,网上给出了两种方案: 方案一:去SDK目录下删掉Temp这个文件夹,并关掉eclipse重新打开. 处理结果:我按照这种说法做了,无效. 方案二:到eclipse的安装目录下的eclipse\plugins目录下找什么0.8的一个jar包,我费力的巡视了一遍没这个东西啊? 处理接果:还是无效. 最后我想想这里边有什么地方是我没有发现的呢,于是我东点一下,西点一下,碰巧点到切换版本的

Maven - settings.xml简易配置Demo

前言 这里贴一下settings.xml的一个简易配置demo,就是简单配置了:本地的仓库地址.阿里云镜像.指定使用jdk1.8进行编译. 这里使用的Maven是3.5.0版本的. 配置文件demo <?xml version="1.0" encoding="UTF-8"?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor lic

160928、JQuery解析XML数据的demo

用JavaScript解析XML数据是常见的编程任务,JavaScript能做的,JQuery当然也能做.下面我们来总结几个使用JQuery解析XML的例子. 方案1 当后台返回的数据类型是xml对象,如下: 那么,前端jquery解析: 就会得到"成功!"这个文字信息. 方案2 当你要解析一个xml文件对象时候,如xmlfile.xml: $.get("xmlfile.xml",function(xml){ $(xml).find("item"

Java 使用 dom4j 读取 xml文档 demo

1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app xmlns="http://www.example.org/web-app_2_5" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 xsi:schemaLocation="http://www.example.org/web-a

Android 的 Relative Layout 常量

android:layout_above 将该控件的底部置于给定ID的控件之上                    --Rule that aligns a child's bottom edge with another child's top edge.android:layout_below 将该控件的顶部置于给定ID的控件之下                    --Rule that aligns a child's top edge with another child's bo

CSS grid layout demo 网格布局实例

直接 上代码,里面我加注释,相当的简单, 也可以去我的github上直接下载代码,顺手给个星:https://github.com/yurizhang/micro-finance-admin-system/blob/master/grid.html <!DOCTYPE html> <html> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,minimum

Android Relative Layout 安卓相对布局详解

思维导图可在幕布找到 1. 基础 如果在相对布局里,控件没有指明相对位置,则默认都是在相对布局的左上角: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#FF00FF" android:padding="20dp" android:text="Item2