zoukankan      html  css  js  c++  java
  • Android Stdio的学习 3

    今天又学习了一些关于Android Stdio的知识。

    1、butten按钮

    <?xml version="1.0" encoding="utf-8"?>
    <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:padding="@dimen/activity_vertical_margin"
        android:orientation="vertical"
        >
      <Button
          android:id="@+id/btn"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="EditText"/>
        <Button
            android:id="@+id/btn2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="button2"
            android:layout_below="@+id/btn"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            />
    
    
    </RelativeLayout>
    

      2、Intent跳转页面

    package com.mingrisoft;
    
    import android.content.Intent;
    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.View;
    
    
    public class MainActivity extends ActionBarActivity implements View.OnClickListener {
    
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
              initUI();
        }
        private void initUI()
        {
            findViewById(R.id.btn).setOnClickListener(this);
        }
        @Override
        public void onClick(View view)
        {
            switch (view.getId()){
                case R.id.btn:
                    Intent intent = new Intent();
                    intent.setClass(getApplicationContext(),EditTextActivity.class);
                    break;
        }
    
                }
    
        }
    

      

    package com.mingrisoft;
    
    import android.support.v7.app.ActionBarActivity;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.Button;
    
    public class EditTextActivity extends ActionBarActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_edit_text);
    
    
    
        }
    
    }
    

      

    <?xml version="1.0" encoding="utf-8"?>
    <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:padding="@dimen/activity_vertical_margin"
        android:orientation="vertical"
        >
      <Button
          android:id="@+id/btn"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="EditText"/>
        <Button
            android:id="@+id/btn2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="button2"
            android:layout_below="@+id/btn"
            android:layout_alignParentRight="true"
            android:layout_alignParentEnd="true"
            />
    
    
    </RelativeLayout>
    

      

    <?xml version="1.0" encoding="utf-8"?>
    <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="com.mingrisoft.EditTextActivity">
        <RelativeLayout
            android:layout_width="130dp"
            android:layout_height="120dp"
           android:background="#000000"
            ></RelativeLayout>
    
    
    </RelativeLayout>
    

      

  • 相关阅读:
    iOS基础教程:在建好的项目中加入CoreData[转]
    iOS开发--使用lipo命令制作模拟器与真机通用静态库
    Linux命令之du
    简单了解gzip、bzip2、xz
    Linux命令之rpm
    进入CentOS7紧急模式恢复root密码
    解决Linux用户模板文件被删除后显示不正常问题
    Linux修改用户基本信息(不含密码)
    Linux用户密码文件/etc/shadow相关
    SecureCRT、Xmanager对Linux上传下载文件或文件夹
  • 原文地址:https://www.cnblogs.com/dixingchen/p/12298126.html
Copyright © 2011-2022 走看看