簡體   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