HackTwo
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" > <Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:onClick="onShowMap"
android:text="@string/show_map" /> <ViewStub
android:id="@+id/map_stub"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:inflatedId="@+id/map_view"
android:layout="@layout/map" /> <include
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
layout="@layout/footer" /> </RelativeLayout>
footer.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="0dp"
android:gravity="center"
android:text="@string/footer_text" />
MainActivity
public class MainActivity extends MapActivity {
private View mViewStub;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mViewStub = findViewById(R.id.map_stub);
}
public void onShowMap(View v) {
mViewStub.setVisibility(View.VISIBLE);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
Ps:对于<include />中用到的android:layout_width和android:layout_height的属性在被引用的布局文件中要申明为0;
HackTwo的更多相关文章
随机推荐
- NOIP2005普及组第4题 循环
NOIP2005普及组第4题 循环 时间限制: 1 Sec 内存限制: 128 MB提交: 27 解决: 6[提交][状态][讨论版][命题人:外部导入] 题目描述 乐乐是一个聪明而又勤奋好学的孩 ...
- PL/SQL本地远程连接数据库
记录自己在开发中只用一次,但是容易忘记的问题,PL/SQL-ORACLE配置远程数据库访问: 1,下载PL/SQL连接工具,链接: https://pan.baidu.com/s/1kVeeLNp 密 ...
- php中的continue用法
continue 2 表示跳出两层 continue 默认跳出一层 if (count($content_arr) > 0 ) { // 获取相应的goods数据 $goodsdata = ar ...
- C++11 变量和函数的链接性
在全局变量前添加const或者static,则该变量链接性为内部,即文件内有效.可以使用extern声明为外部. 如果要让函数的链接性为内部,则函数声明和定义都应使用static关键字. 例子: te ...
- python签名设计
将一个签名网站http://www.uustv.com/的内容爬下来显示出来 代码:sign.py from tkinter import * from tkinter import messageb ...
- Android 学习 - Telnet 控制AVD
启动Android Virtual Device之后,使用telnet,可以方便地控制AVD. 首先,获取端口号.启动AVD后,在标题栏上方会出现端口号:设备名,在下面的截图中为5554:N4-15- ...
- 处理大数据对象clob数据和blob数据
直接上下代码: package com.learn.jdbc.chap06; import java.io.File; import java.io.FileInputStream; import j ...
- Java微信公众平台开发(四)--回复消息的分类及实体的创建
转自:http://www.cuiyongzhi.com/post/42.html 前面有说道对接收到微信服务器消息后对消息的分类,当时主要分为普通消息和事件消息,这里我们要讲述的是我们在给用户回复的 ...
- 【原】Coursera—Andrew Ng机器学习—课程笔记 Lecture 1_Introduction and Basic Concepts 介绍和基本概念
目录 1.1 欢迎1.2 机器学习是什么 1.2.1 机器学习定义 1.2.2 机器学习算法 - Supervised learning 监督学习 - Unsupervised learning 无 ...
- 新浪微博logo已经去掉了“新浪”二字
如果有一天我能做出一个产品,它的命名就以我所在的行业命名该多好啊,可惜那只是一个梦.但这样的梦新浪微博却实现了,今天我登陆新浪微博的时候发 现logo已经去掉了“新浪”二字,我开始还以为我自己的电脑网 ...