zoukankan      html  css  js  c++  java
  • Andoird Studio写一个简单的生词本项目

    此博客链接:

    1.在activity_main.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:background="#CCCCCC"
        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" >
     
        <LinearLayout 
            android:layout_marginTop="50dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            
            <Button 
                style="?android:attr/buttonBarButtonStyle"
                android:id="@+id/insert"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:background="@drawable/shape" />
            <Button
                style="?android:attr/buttonBarButtonStyle"
                android:id="@+id/search"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape" />
            <Button 
                style="?android:attr/buttonBarButtonStyle"
                android:id="@+id/delete"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:background="@drawable/shape" />
            
        </LinearLayout>
        
        <RelativeLayout 
            android:layout_marginTop="200dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            
            <EditText 
                android:id="@+id/word"
                android:background="@drawable/edittextshape"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:padding="3dp"
                android:inputType="textUri"
                android:hint="@string/word" />
     
            <ImageButton
                android:id="@+id/clear1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:contentDescription="@string/clear"
                android:src="@drawable/clear"
                android:visibility="visible" />
            
        </RelativeLayout>
        <RelativeLayout 
            android:layout_marginTop="300dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">        
            <EditText 
                android:inputType="text"
                android:id="@+id/detail"
                android:background="@drawable/edittextshape"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:padding="3dp"
                android:hint="@string/detail"
                android:textColorHint="#AAAAAA" />        
            <ImageButton
                android:id="@+id/clear2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:contentDescription="@string/clear"
                android:src="@drawable/clear"
                android:visibility="visible" />
            
        </RelativeLayout>
        <RelativeLayout 
            android:layout_marginTop="400dp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">        
            <EditText 
                android:background="@drawable/edittextshape"
                android:inputType="textUri"
                android:id="@+id/search_edittext"
                android:layout_width="match_parent"
                android:layout_height="50dp"
                android:padding="3dp"
                android:hint="@string/search" />
            
            <ImageButton
                android:id="@+id/clear3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:contentDescription="@string/clear"
                android:src="@drawable/clear"
                android:visibility="visible" />        
        </RelativeLayout>
    </RelativeLayout>

     

  • 相关阅读:
    rh
    re模块
    粘包现象
    子类调用父类方法
    北大医院条码
    戴德金-连续性和无理数-第1页
    数学名词
    核心英语笔记,含记忆术mnemonics
    python笔记
    收集的句子
  • 原文地址:https://www.cnblogs.com/ping2yingshi/p/13095805.html
Copyright © 2011-2022 走看看