WangYiActivity.java:

public class WangYiActivity extends Activity implements OnClickListener{

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.wangyi);
        TextView tv=(TextView)findViewById(R.id.panjiwen);
        TextView t=(TextView)findViewById(R.id.xianshi);
        tv.setOnClickListener(this);
        Intent intent=getIntent();
        String userName=intent.getStringExtra("userName");
        String name=intent.getStringExtra("name");
        int age=intent.getIntExtra("age", 0);
        t.setText("姓名:"+userName+",年龄"+age+""+name);
 }

@Override
 public void onClick(View v) {
  Intent intent=new Intent(WangYiActivity.this,WangYi1Activity.class) ;
  startActivity(intent);
 }

}

WangYi1.java:

public class WangYi1Activity extends Activity {

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.wangyi1);

}

}

WangYi.xml:

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

<TableRow android:background="#ff0000" >

<ImageView
            android:id="@+id/a"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/night_base_pull_list_msg_indicator_arrow_up_drawable" />

<ImageView
            android:id="@+id/b"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="64dp"
            android:src="@drawable/biz_widget_tag" />

<Spinner
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_marginLeft="64dp"
            android:entries="@array/wangyi" />
    </TableRow>

<GridLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#999"
        android:columnCount="5"
        android:rowCount="2" >

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="要闻"
            android:textSize="20dp" />

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:text="国内"
            android:textSize="20dp" />

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="50dp"
            android:text="国际"
            android:textSize="20dp" />

<TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_column="2"
            android:layout_gravity="center_horizontal|top"
            android:layout_marginLeft="120dp"
            android:layout_row="0"
            android:text="社会"
            android:textSize="20dp" />
    </GridLayout>

<TableLayout>

<TableRow android:layout_marginTop="10dp" >

<ImageView
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:src="@drawable/xijinpin" />

<LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="mumu宣布南京青奥会开幕"
                    android:textSize="15sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="mumu宣布南京青奥会今晚正式开幕"
                    android:textSize="10sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="160dp"
                    android:layout_marginTop="10dp"
                    android:text="1234跟帖"
                    android:textSize="10sp" />
            </LinearLayout>
        </TableRow>

<TableRow android:layout_marginTop="10dp" >

<ImageView
                android:layout_width="70dp"
                android:layout_height="60dp"
                android:scaleType="fitXY"
                android:src="@drawable/jinxiuxian" />

<LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="都教授将献唱,神秘女点燃圣火"
                    android:textSize="15sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="都教授将献唱主题曲,陈若琳点燃圣火"
                    android:textSize="10sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="160dp"
                    android:layout_marginTop="10dp"
                    android:text="5456跟帖"
                    android:textSize="10sp" />
            </LinearLayout>
        </TableRow>

<TableRow android:layout_marginTop="10dp" >

<ImageView
                android:layout_width="70dp"
                android:layout_height="60dp"
                android:scaleType="fitXY"
                android:src="@drawable/panjiwen" />

<LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical" >

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="潘基文卖萌:我长得像都敏俊"
                    android:id="@+id/panjiwen"
                    android:textSize="15sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:text="此前彭丽媛访韩称mumu年轻时长得像都敏俊"
                    android:textSize="10sp" />

<TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="160dp"
                    android:layout_marginTop="10dp"
                    android:text="5643跟帖"
                    android:textSize="10sp" />
            </LinearLayout>
        </TableRow>
    </TableLayout>

<Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#999"
        android:text="点击查看更多" />

<Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="160dp"
        android:background="#ffffff"
        android:text="回顶部↑" />
<TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/xianshi"
    />
</TableLayout>

WangYi1.xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

<TableLayout
        android:id="@+id/a"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" >

<TableRow android:background="#ff0000" >

<TextView
                android:id="@+id/a"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="&lt;" />

<Spinner
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_marginLeft="220dp"
                android:entries="@array/wangyi" />
        </TableRow>
    </TableLayout>

<TextView
        android:id="@+id/b"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/a"
        android:layout_marginTop="10dp"
        android:text="潘基文讲中文:我长得像都敏俊"
        android:textSize="20dp" />

<TextView
        android:id="@+id/c"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/b"
        android:layout_marginTop="10dp"
        android:text="人民网2014-08-16 16:49" />

<TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/b"
        android:layout_marginTop="10dp"
        android:layout_toRightOf="@id/c"
        android:text="跟帖20876条"
        android:textColor="#ff0000" />

<ImageView
        android:id="@+id/d"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_below="@id/c"
        android:layout_marginTop="10dp"
        android:scaleType="fitXY"
        android:src="@drawable/jinxiuxian" />
    <ImageView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_above="@+id/textView2"
        android:layout_marginLeft="160dp"
        android:scaleType="fitXY"
        android:src="@drawable/panjiwen" />
   
    <TextView
        android:id="@+id/textView2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/d"
        android:layout_marginTop="10dp"
        android:text="       联合国秘书长潘基文在南京大学的对话中国青年活动上用中文自我介绍:
        大家好,我是潘基文,不是都敏俊,我们长得很像。全场大笑,掌声雷动。据悉,今晚潘基文和都敏俊都将出现在青奥会开幕式上" />
<TableLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/textView2"
        android:gravity="center_vertical">

<TableRow android:background="#008000" >

<TextView
                android:id="@+id/e"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:text="分享到" />
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/sns_qzone_icon"
                 />
             <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:src="@drawable/sns_renren_icon"
                />

<ImageView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:src="@drawable/sns_sina_icon" />

<ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:src="@drawable/sns_weixin_icon"
                />
              
        </TableRow>
        <TableRow android:background="#ffffff"
            android:layout_marginTop="10dp"
            >
            <TextView
                 android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="网友跟帖"
                android:textSize="20dp"
                />
            <TextView
                 android:layout_width="wrap_content"
                android:layout_height="wrap_content" 
                android:text="20876"
                android:textColor="#ff0000"
                />
            <TextView
                 android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="发表评论"
                android:layout_marginLeft="60dp"
                android:textSize="20dp"
                />
        </TableRow>
       
    </TableLayout>
   <Button
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#ffffff"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:layout_marginLeft="200dp"
                android:text="回顶部↑" />
</RelativeLayout>

初学android之简易的网易页面的更多相关文章

  1. Android开发简易教程

    Android开发简易教程 Android 开发因为涉及到代码编辑.UI 布局.打包等工序,有一款好用的IDE非常重要.Google 最早提供了基于 Eclipse 的 ADT 作为开发工具,后来在2 ...

  2. 实现android手机来电拦截系统页面弹出自定义页面特效

    如何实现android手机来电拦截系统页面弹出自定义页面特效, 首先:    我们需要注册一个监听来电的广播PhoneStateReceiver 类:其次:    在onReceive里面我们获取an ...

  3. 基于Android 平台简易即时通讯的研究与设计[转]

    摘要:论文简单介绍Android 平台的特性,主要阐述了基于Android 平台简易即时通讯(IM)的作用和功能以及实现方法.(复杂的通讯如引入视频音频等可以考虑AnyChat SDK~)关键词:An ...

  4. Android 获取浏览器当前分享页面的截屏

    Android 获取浏览器当前分享页面的截屏 版权声明:本文为博主原创文章,未经博主允许不得转载. 微博:厉圣杰 源码:AndroidDemo/BrowserScreenShotActivity 文中 ...

  5. Android - TabHost 与 Fragment 制作页面切换效果

    Android - TabHost 与 Fragment 制作页面切换效果 Android API 19 , API 23 三个标签页置于顶端 效果图: 在文件BoardTabHost.java中定义 ...

  6. Android实战简易教程-第三十九枪(第三方短信验证平台Mob和验证码自己主动填入功能结合实例)

    用户注冊或者找回password时通常会用到短信验证功能.这里我们使用第三方的短信平台进行验证实例. 我们用到第三方短信验证平台是Mob,地址为:http://mob.com/ 一.注冊用户.获取SD ...

  7. Android实战简易教程-第四十枪(窃听风云之短信监听)

    近期在做监听验证码短信自己主动填入的功能,无意间想到了一个短信监听的办法. 免责声明:短信监听本身是一种违法行为,这里仅仅是技术描写叙述.请大家学习技术就可以.(哈哈) 本实例是基于bmob提供的后台 ...

  8. Android实战简易教程-第二十六枪(基于ViewPager实现微信页面切换效果)

    1.头部布局文件top.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout x ...

  9. 【Android】纯代码创建页面布局(含异步加载图片)

    开发环境:macOS 10.12 + Android Studio 2.2,MinSDK Android 5.1 先看看总体效果 本示例是基于Fragment进行的,直接上代码: [界面结构] 在 F ...

随机推荐

  1. redis入门笔记(2)

    redis入门笔记(2) 上篇文章介绍了redis的基本情况和支持的数据类型,本篇文章将介绍redis持久化.主从复制.简单的事务支持及发布订阅功能. 持久化 •redis是一个支持持久化的内存数据库 ...

  2. Dubbo框架

    1. Dubbo是什么? Dubbo是一个分布式服务框架,致力于提供高性能和透明化的RPC远程服务调用方案,以及SOA服务治理方案.简单的说,dubbo就是个服务框架,如果没有分布式的需求,其实是不需 ...

  3. 第一次在linux上登录博客

    这是我第一次在linux操作系统上登录博客,额,虽然是在X-window上面.好吧,是我太激动了. 这意味着我已经步入linux的世界了,虽然中文输入法不太好用,但是我还是写一下我的心情吧. 从去年的 ...

  4. 1.5 linux笔记

    fdisk /dev/sda   查看sda下硬盘状态 fdisk l 看LIST所有文件系统 fdisk n 创建分区 fdisk m help fdisk p 查看所有分区 fdisk w 保存分 ...

  5. PHP-PHP-FPM的max_children一些误区

    现在nginx + fpm 基本成为主流的配置,其中我们比较关注的是pm.max_chindren的配置 首先,我们关注一个前提设置: pm = static/dynamic, 这个选项是标识fpm子 ...

  6. Android学习九:屏幕自适应

    android中不同手机分辨率适配问题 在项目开发的过程中,同一个布局对应不同的手机会显示出不同的效果.导致这个现象产生的原因是不同手机的分辨率不同.在android sdk提供的帮助文档中,我们可以 ...

  7. 原创跑酷小游戏《Cube Duck Run》 - - 方块鸭快跑

    自从unity5出来才开始关注unity,业余时间尝试做了个小游戏: <方块鸭快跑> (Cube Duck Run) 像素风,3d视角,色彩明快,有无尽和关卡两种模式. 应用连接: goo ...

  8. maven 环境搭建

    1.maven环境搭建 1)下载maven,http://maven.apache.org/download.cgi,到本地解压,然后配置环境变量 MAVEN_HOME:D:\software\apa ...

  9. Tomcat部署Solr4.10.4

    前段时间学习solr,兴致勃勃的从官网下载到solr5.3.0最新版本,然后在后期部署时出现了很多问题.首先,4.0到5.0是个大版本更新,下载 的压缩包的文件结构有了很多变化,导致网上很多关于sol ...

  10. 读取DBF文件数据

    #region 返回DBF表 public static System.Data.DataTable getDTFromDBF(string fullPath) { string pDir = Sys ...