簡體   English   中英

如何將FloatingActionButton添加到工具欄?

[英]How to add a FloatingActionButton to the toolbar?

問題:我需要補充的是兩個FAB 落實到工具欄。 將兩個按鈕都放在右下角似乎占用了屏幕太多的空間。

問題:如何向工具欄添加FloatingActionButton?

問題中的所有元素都是一個簡單的View 他們全部!

這意味着,您所要做的就是僅使用所需位置上的視圖構建布局。 就像使用LinearLayout,RelativeLayout,ImageView,TextView等一樣。

具體的實現將取決於您實際想要的外觀。 但是可能類似下面的偽XML的東西會讓您入門。

<LinearLayout orientation=vertical>

   <AppBarLayout>
      <Toolbar />

      <com.github.jorgecastilloprz.FABProgressCircle>
         <android.support.design.widget.FloatingActionButton />
      </com.github.jorgecastilloprz.FABProgressCircle>
   </AppBarLayout>

   <FrameLayout height=match_parent>
        ... your app content comes here
   </FrameLayout>

</LinearLayout>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM