繁体   English   中英

Android:如何创建音乐播放器?

[英]Android: How to create music player?

如何在显示页面的底部设置这种类型的布局? 一页进入管理播放和停止歌曲。

在此处输入图片说明

您可以在Activity实现底部栏,并且在Activity应具有用于其他布局的Fragments

这是从头开始在Android中实现Music Player的出色教程:在Android上创建Music Player

另一个很酷的功能: Android向上滑动面板模仿了Google Play音乐的相同功能,同时向上滑动了当前播放音乐。

Android滑动面板

您可以通过setVisibility(View.GONE / View.VISIBLE / View.INVISIBLE)和FrameLayout更改视图。 另一种方法,了解片段。 希望对您有所帮助。

您可以像这样轻松完成:

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="New Button"
        android:id="@+id/button"
        android:layout_alignParentBottom="true" />
    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/button">
    </ListView>
</RelativeLayout>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM