[英]Android: How to create music player?
您可以在Activity
實現底部欄,並且在Activity
應具有用於其他布局的Fragments
。
這是從頭開始在Android中實現Music Player的出色教程:在Android上創建Music Player 。
另一個很酷的功能: Android向上滑動面板模仿了Google Play音樂的相同功能,同時向上滑動了當前播放音樂。
您可以通過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.