0
A
回答
2
你可以在FrameLayout的幫助下做到。
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="280dp"
android:layout_gravity="center"
app:cardElevation="8dp"
card_view:cardCornerRadius="5dp">
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<SlidingTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#2D73A9"
android:elevation="2dp" />
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
<FrameLayout
android:id="@+id/buttonPanel"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="top|end"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp">
<Button
android:id="@+id/expand"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/img_chart_expand"
android:visibility="gone" />
</FrameLayout>
</FrameLayout>
0
是否有意義添加旁邊TabLayout
按鈕?管理起來要容易得多(只需要一個包含alignParentRight
和tabLayout to_leftOf
的按鈕),結果將是一樣的。
相關問題
- 1. 在滑動選項卡布局的選項卡上設置圖標適合屏幕的選項卡
- 2. 在jQuery UI選項卡上製作一個「添加選項卡」按鈕
- 3. 向按鈕添加自動佈局
- 4. Android:動態添加按鈕佈局
- 5. 在特定選項卡上添加按鈕
- 6. 在佈局模式下顯示「選項卡控制按鈕」
- 7. 安卓選項卡布局與選項卡文本中的箭頭按鈕
- 8. Android Studio - 滑動視圖與選項卡布局
- 9. 用兩個Viewpager和一個選項卡布局滑動問題
- 10. 在java中按下按鈕後添加選項卡
- 11. 將按鈕和可滾動面板添加到選項卡 - Java
- 12. 如何在XML佈局中添加選項卡和工具欄
- 13. 在選項卡之間滑動時,指針事件被選項卡窗格上的按鈕捕獲
- 14. 使用選項卡android中的佈局 - 添加到一個選項卡的按鈕出現在所有選項卡
- 15. 動態添加選項卡
- 16. 動態添加選項卡
- 17. 佈局到選項卡TabView
- 18. Android Tab選項卡布局
- 19. Jquery EasyUI選項卡布局
- 20. 添加按鈕到PyQtGraph佈局
- 21. 使用視圖添加按鈕佈局
- 22. 將活動類添加到按鈕上的引導選項卡單擊
- 23. 當該按鈕上的選項卡(選定)時更改顏色並獲得其他按鈕的正常佈局
- 24. 如何在片段佈局上添加按鈕?(Google maps Android studio)
- 25. 如何在選項卡中添加關閉按鈕,JTabbedPane
- 26. 在最後一個選項卡項目之後在WPF選項卡控件中添加加號按鈕?
- 27. 滑動選項卡 - NullPointerException - Toolbar.getTitle()
- 28. 滑動選項卡主機
- 29. 如何清除舊選項卡並在選項卡上添加新選項卡
- 30. 在相關佈局中添加一個動態tablelayout在現有按鈕上方
是的我試過了,但滑動條的行爲發生變化,頁面無法順暢滑動! –