Android 开发笔记___滚动视图__scroll view
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="演示效果"
android:textColor="@color/text_color"
android:textSize="25sp"
android:layout_gravity="center"/> <LinearLayout
android:layout_width="match_parent"
android:layout_height="200dp"> <HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"> <LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"> <View
android:layout_width="400dp"
android:background="#aaffff"
android:layout_height="match_parent"/> <View
android:layout_width="400dp"
android:layout_height="match_parent"
android:background="#ffff00"/> </LinearLayout>
</HorizontalScrollView> </LinearLayout> <ScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"> <LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"> <View
android:layout_width="match_parent"
android:background="#aa5511"
android:layout_height="400dp"/> <View
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#ffff00"/> <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="scrollview 的使用,有两种。\n垂直方向、水平方向。\n视图里面只能放一个布局"/> </LinearLayout> </ScrollView> </LinearLayout>
java
package com.example.alimjan.hello_world; import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable; /**
* Created by alimjan on 6/30/2017.
*/ public class class__2_2_3 extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.code_2_2_3);
} public static void startHome(Context mContext) {
Intent intent = new Intent(mContext, class__2_2_3.class);
mContext.startActivity(intent);
}
}
Android 开发笔记___滚动视图__scroll view的更多相关文章
- Android 开发笔记___图像视图__简单截屏
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- Android 开发笔记___图像视图
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=&quo ...
- Android 开发笔记___初级控件之实战__计算器
功能简单,实现并不难,对于初学者可以总和了解初级控件的基本使用. 用到的知识点如下: 线性布局 LinearLayout:整体界面是从上往下的,因此需要垂直方向的linearlayout:下面每行四个 ...
- Android 开发笔记___基本适配器的使用__BaseAdapter
之前用到过ArryAdapter适用于纯文本的列表数据,SimpleAdapter适用于带图标的列表数据,但在实际应用中常常有更复杂的列表,比如同一项中存在多个控件,这时候用前面的两个会比较复杂,而且 ...
- Android 开发笔记___时间选择器---timePicker
像datepicker一样,也有timepicker. 同样有timepickerdialog 所用到的方法还是一样,监听时间选择器的变化. package com.example.alimjan.h ...
- Android 开发笔记___实战项目:购物车
购物车的应用很广泛,电商app基本上都有它的身影.由于它用到了多种存储方式,通过项目对数据的存储有更高层次的了解. 1.设计思路 首先看看购物车的外观.第一次进入时里面是空的,去购物页面加入购物车以后 ...
- Android 开发笔记___存储方式__共享参数__sharedprefences
Android 的数据存储方式有四种,这次是[共享参数__sharedprefences] 听起来挺别扭的,平时看到的app里面,当用户删除了一些软件以后下次安装,发现原来的设置还在,这种情况就是把一 ...
- Android 开发笔记___登陆app
package com.example.alimjan.hello_world; /** * Created by alimjan on 7/4/2017. */ import android.con ...
- Android 开发笔记___图像按钮__imageButton
IMAGEBUTTON 其实派生自image view,而不是派生自button.,image view拥有的属性和方法,image button 统统拥有,只是imagebutton有个默认的按钮外 ...
随机推荐
- 协议端口号(protocol port number)
协议端口号(protocol port number) 先来个注意事项 (-> ->) 这种在协议层间的抽象的协议端口是软件端口,和硬件端口是完全不同的概念.硬件端口是不同设备进行交互的接 ...
- 再起航,我的学习笔记之JavaScript设计模式26(解释器模式)
解释器模式 概念介绍 解释器模式(Interpreter):给定一个语言,定义它的文法的一种表示,并定义一个解释器,这个解释器使用该表示来解释语言中的句子. 获取元素在页面中的路径 我们都知道获取一个 ...
- Es6 Promise 用法详解
Promise是什么?? 打印出来看看 console.dir(Promise) 这么一看就明白了,Promise是一个构造函数,自己身上有all.reject.resolve这几个眼熟的方 ...
- 深入浅出AQS之条件队列
相比于独占锁跟共享锁,AbstractQueuedSynchronizer中的条件队列可能被关注的并不是很多,但它在阻塞队列的实现里起着至关重要的作用,同时如果想全面了解AQS,条件队列也是必须要学习 ...
- Kotlin实现《第一行代码》案例“酷欧天气”
看过<第一行代码>的朋友应该知道“酷欧天气”,作者郭神用整整一章的内容来讲述其从无到有的过程. 最近正好看完该书的第二版(也有人称“第二行代码”),尝试着将项目中的Java代码用Kotli ...
- Fitnesse - Slim Tables
Fitnesse - Slim Tables 2017-09-28 目录1 什么是Wiki Word?2 Query Table 2.1 Query Table的格式 2.2 源代码3 Scri ...
- java.security.InvalidKeyException: Illegal key size
今天遇到一个奇怪的问题. 自己做的加签验签功能已经没有问题了,本地测试通过,同事放到服务器上测试也没问题. 然后我将包放到自己搭建的环境上,会报这样一个错误: java.security.Invali ...
- 关闭eclipse自动弹出console的功能
当启动项目后,console有值时就会弹出,挺烦人的,可以如下修改
- 如何从MVP模式进阶到Clean模式
从类图上来看,MVP都是一个业务一个Presenter,每个Presenter都是一个接口,它还包含了View的接口,用于定于和View相关的行为,然后Activity等业务类实现View的接口,因为 ...
- 微信小程序- 生成二维码
wx.request({ // 获取token url: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential', ...