博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Android学习笔记技巧之垂直和水平滚动视图
阅读量:7218 次
发布时间:2019-06-29

本文共 1758 字,大约阅读时间需要 5 分钟。

 

[java]
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:layout_width="fill_parent"  
  4.     android:layout_height="wrap_content" >  
  5.   
  6.     <HorizontalScrollView  
  7.         android:layout_width="fill_parent"  
  8.         android:layout_height="wrap_content" >  
  9.   
  10.         <RelativeLayout  
  11.             android:layout_width="fill_parent"  
  12.             android:layout_height="fill_parent"  
  13.             android:orientation="horizontal" >  
  14.   
  15.             <TextView  
  16.                 android:id="@+id/textview1"  
  17.                 android:layout_width="wrap_content"  
  18.                 android:layout_height="wrap_content"  
  19.                 android:gravity="center_vertical"  
  20.                 android:text="垂直和水平滚动"  
  21.                 android:textSize="30dp" />  
  22.               
  23.             <ImageView  
  24.                 android:id="@+id/imageview1"  
  25.                 android:layout_width="wrap_content"  
  26.                 android:layout_height="wrap_content"  
  27.                 android:layout_below="@id/textview1"  
  28.                 android:src="@drawable/item1" />  
  29.   
  30.             <ImageView  
  31.                 android:id="@+id/imageview2"  
  32.                 android:layout_width="wrap_content"  
  33.                 android:layout_height="wrap_content"  
  34.                 android:layout_toRightOf="@id/imageview1"  
  35.                 android:layout_below="@id/textview1"  
  36.                 android:src="@drawable/item2" />  
  37.   
  38.             <TextView  
  39.                 android:id="@+id/textview2"  
  40.                 android:layout_width="wrap_content"  
  41.                 android:layout_height="wrap_content"  
  42.                 android:layout_below="@id/imageview1"  
  43.                 android:text="垂直和水平滚动"  
  44.                 android:textSize="30dp" />  
  45.   
  46.             <ImageView  
  47.                 android:id="@+id/imageview2"  
  48.                 android:layout_width="wrap_content"  
  49.                 android:layout_height="wrap_content"  
  50.                 android:layout_below="@id/textview2"  
  51.                 android:src="@drawable/item3" />  
  52.         </RelativeLayout>  
  53.     </HorizontalScrollView>  
  54.   
  55. </ScrollView>  

 

[java]
    1. package net.blogjava.mobile;  
    2.   
    3. import android.app.Activity;  
    4. import android.os.Bundle;  
    5.   
    6. public class Main extends Activity {  
    7.     /** Called when the activity is first created. */  
    8.     @Override  
    9.     public void onCreate(Bundle savedInstanceState) {  
    10.         super.onCreate(savedInstanceState);  
    11.         setContentView(R.layout.main);  
    12.     }  

转载地址:http://zetym.baihongyu.com/

你可能感兴趣的文章
Spring 教程(二) 体系结构
查看>>
Indexes
查看>>
2.Web中使用iReport 整合----------创建html格式的
查看>>
异常备忘:java.lang.UnsupportedClassVersionError: Bad version number in .class file
查看>>
最全三大框架整合(使用映射)——applicationContext.xml里面的配置
查看>>
初步理解Java的三大特性——封装、继承和多态
查看>>
知识点积累(一)
查看>>
iphone-common-codes-ccteam源代码 CCFile.m
查看>>
python:浅析python 中__name__ = '__main__' 的作用
查看>>
修改tomcat端口后不能IP访问问题
查看>>
review board
查看>>
URAL 1495 One-two, One-two 2
查看>>
牛客国庆集训派对Day3 G Stones
查看>>
虚函数简单总结
查看>>
插入排序--算法导论
查看>>
NoSQL -- Redis使用
查看>>
处理iphone的 .play() 不能播放问题
查看>>
jetty404web界面服务器信息隐藏
查看>>
22个Photoshop网页设计教程网站推荐
查看>>
如何让程序员更容易的开发Web界面?重构SmartAdmin展示TinyUI
查看>>