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>
    

      

  • 相关阅读:
    Linux mint OS
    Patroni 修改配置
    0x10
    01
    split
    IO流18 --- RandomAccessFile实现数据的读写操作 --- 技术搬运工(尚硅谷)
    IO流16 --- 对象流操作字符串 --- 技术搬运工(尚硅谷)
    IO流15 --- 数据流操作Java语言的基本数据类型 --- 技术搬运工(尚硅谷)
    IO流14 --- 打印流的使用 --- 技术搬运工(尚硅谷)
    JDBC2 --- 获取数据库连接的方式二 --- 技术搬运工(尚硅谷)
  • 原文地址:https://www.cnblogs.com/dixingchen/p/12298126.html
Copyright © 2011-2022 走看看