Android开发便签APP

1.设计知识:

framelayout、floatingactionbutton、menu、listview、adapter、sqlite

2.开发工具:

Android Studio 3.1.1

工程目录:

3.界面设计:

a.主界面:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <ListView
            android:id="@+id/layout_listview"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        </ListView>
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/add_note"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="15dp"
            android:src="@mipmap/add_picture"
            />
    </FrameLayout>

</android.support.design.widget.CoordinatorLayout>

 

页面如下:

 

 

注意:

当我们使用floatingactionbutton时,一定是要在framelayout布局之内放置listview和floatingactionbutton,如果不是这样,会因为布局的重合而导致floatingactionbutton被覆盖掉,而使用framelayout页面重合时只是重合布局之内的控件,而不会覆盖前面的布局的东西(具体原因请查看博客:https://blog.youkuaiyun.com/major_out/article/details/50656383)

b.新建页面/显示页面:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_margin="10dp"
                >
                <TextView
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/new_title"
                    android:textSize="24dp"
                    android:textColor="@color/colorPrimaryDark"
                    />
                <EditText
                    android:id="@+id/title"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="4"
                    android:hint="@string/new_settitle"
                    android:ems="10"
                    android:textSize="24dp"
                    />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/new_content"
                    android:textColor="@color/colorPrimaryDark"
                    android:textSize="24dp" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_margin="10dp">
                <EditText
                    android:id="@+id/content"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:gravity="top"
                    android:hint="@string/new_inputcontent"
                    android:textSize="24dp"
                    android:background="@null"/>
            </LinearLayout>
    
评论 192
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值