借助DrawerLayout实现侧滑菜单

使用的时候根布局是

android.support.v4.widget.DrawerLayout

在AndroidStudio中好像是直接可以使用,据说eclipse要先自己添加.
在drawerLayout中设置多个子控件.第一个子控件默认是主界面,不需要侧滑菜单是显示的部分写在这里.之后放的控件需要有属性

android:layout_gravity

选start或者end表示菜单在左侧或者右侧.
如果先东西太多可以分别在别的xml中写界面,写好在include进去.

如果需要通过按钮唤出或关闭菜单需要用到drawerLayou.openDrawer(drawerView)/closeDrawer(drawerView)方法,drawerView是在DrawerLayout布局中的第二个子节点(菜单布局).

activity_main

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/dl_left"
    android:layout_width="match_parent"
    android:layout_height="match_parent"

    android:fitsSystemWindows="true"
    android:clipToPadding="true">
    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <include layout="@layout/activity_zhu"/>
    </FrameLayout>

    <RelativeLayout
        android:layout_width="240dp"
        android:layout_height="match_parent"
        android:background="#ad85d2f7"
        android:layout_gravity="start"
        >


        <include layout="@layout/activity_menu"/>

    </RelativeLayout>



</android.support.v4.widget.DrawerLayout>

activity_zhu

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        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:gravity="top"
        android:orientation="vertical"
        tools:context=".activity.ActivityMain">

        <include layout="@layout/title_with_text"/>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            >


            <FrameLayout
                android:id="@+id/fragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >
            </FrameLayout>


            <ImageButton
                android:id="@+id/fab_add"
                android:layout_width="56dp"
                android:layout_height="56dp"
                android:layout_gravity="bottom|right"
                android:layout_margin="20dp"
                android:background="@drawable/fab_background"
                android:src="@drawable/fab_src_add"
                />

        </FrameLayout>






        <LinearLayout
            android:id="@+id/m"
            android:layout_width="match_parent"
            android:layout_height="45dp"
            android:background="#F7F9FA">

            <RelativeLayout
                android:id="@+id/table_zichan"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:clickable="true">

                <ImageView
                    android:id="@+id/table_img_zichan"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:src="@drawable/table_unfocus_zichan"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:textColor="@color/colorTableText"
                    android:text="资产"/>

            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/table_huikuan"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:clickable="true">

                <ImageView
                    android:id="@+id/table_img_huikuan"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:src="@drawable/table_unfocus_huikuan"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:textColor="@color/colorTableText"
                    android:text="回款"/>

            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/table_shijianzhou"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:clickable="true">

                <ImageView
                    android:id="@+id/table_img_shijianzhou"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:src="@drawable/table_unfocus_shijianzhou"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:textColor="@color/colorTableText"
                    android:text="时间轴"/>

            </RelativeLayout>

            <RelativeLayout
                android:id="@+id/table_faxian"
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:clickable="true">

                <ImageView
                    android:id="@+id/table_img_faxian"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_alignParentTop="true"
                    android:layout_centerHorizontal="true"
                    android:src="@drawable/table_unfocus_faxian"/>
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true"
                    android:textColor="@color/colorTableText"
                    android:text="发现"/>

            </RelativeLayout>
        </LinearLayout>

    </LinearLayout>

</LinearLayout>

activity_menu

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ListView
        android:id="@+id/menu_listview"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    </ListView>
</LinearLayout>

不过据说Android7.x就要取消侧滑菜单…这还想Android吗(摔

还是很好用的….

内容概要:该论文聚焦于6G通信中20-100GHz频段的电磁场(EMF)暴露评估问题,提出了一种基于自适应可重构架构神经网络(RAWA-NN)的预测框架。该框架通过集成权重分析模块和优化模块,能够自动优化网络超参数,显著减少训练时间。模型使用70%的前臂数据进行训练,其余数据用于测试,并用腹部和股四头肌数据验证模型泛化能力。结果显示,该模型在不同参数下的相对差异(RD)在前臂低于2.6%,其他身体部位低于9.5%,可有效预测皮肤表面的温升和吸收功率密度(APD)。此外,论文还提供了详细的代码实现,涵盖数据预处理、权重分析模块、自适应优化模块、RAWA-NN模型构建及训练评估等内容。 适合人群:从事电磁兼容性研究、6G通信技术研发以及对神经网络优化感兴趣的科研人员和工程师。 使用场景及目标:①研究6G通信中高频段电磁暴露对人体的影响;②开发更高效的电磁暴露评估工具;③优化神经网络架构以提高模型训练效率和预测精度。 其他说明:论文不仅提出了理论框架,还提供了完整的代码实现,方便读者复现实验结果。此外,论文还讨论了未来的研究方向,包括扩展到更高频段(如300GHz)的数据处理、引入强化学习优化超参数、以及实现多物理场耦合的智能电磁暴露评估系统。建议读者在实际应用中根据具体需求调整模型架构和参数,并结合真实数据进行验证。
内容概要:本文是北京金融科技产业联盟发布的《基于数据空间的金融数据可信流通研究报告》,探讨了金融数据可信流通的现状、挑战和发展前景。文章首先介绍了金融数据在数字化转型中的重要性及其面临的隐私保护和安全挑战。接着,文章详细阐述了数据空间的概念及其发展历程,尤其是可信数据空间(TDM)在我国的发展情况。文中还深入分析了金融数据可信流通的典型应用场景、关键技术和方案架构,如数据访问控制、数据使用控制、智能合约、数据脱敏等。最后,文章展示了多个典型场景应用案例,如中信银行总分行数据流通管控、工银金租数据流通、银联安全生物特征支付等,并总结了当前可信数据空间建设中存在的法规、技术、标准和商业模式挑战,提出了相应的政策建议。 适用人群:金融行业从业者、数据安全管理人员、政策制定者、科技研发人员等。 使用场景及目标:①理解金融数据可信流通的重要性和挑战;②学习可信数据空间的关键技术和应用场景;③探索金融数据可信流通的具体实践案例;④了解当前可信数据空间建设的瓶颈和未来发展方向。 其他说明:本文不仅提供了详尽的技术和应用分析,还提出了具体的政策建议,有助于推动金融数据可信流通的健康发展。阅读本文可以帮助读者深入了解金融数据安全保护和高效利用的最佳实践,为相关政策和技术的发展提供参考。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值