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. PyQt動態添加按鈕的選項卡 - 佈局問題
- 2. 在選項卡布局中的選項卡行上添加文本
- 3. 在滑動選項卡布局的選項卡上設置圖標適合屏幕的選項卡
- 4. 在jQuery UI選項卡上製作一個「添加選項卡」按鈕
- 5. 向按鈕添加自動佈局
- 6. Android:動態添加按鈕佈局
- 7. IOS添加按鈕自動佈局
- 8. 在新創建的選項卡上添加按鈕
- 9. 如何在viewpager中的選項卡上添加一個按鈕
- 10. 在特定選項卡上添加按鈕
- 11. 在佈局模式下顯示「選項卡控制按鈕」
- 12. 安卓選項卡布局與選項卡文本中的箭頭按鈕
- 13. 在相對佈局中添加按鈕
- 14. 具有可滑動視圖出錯的Android選項卡布局
- 15. Android Studio - 滑動視圖與選項卡布局
- 16. 安卓選項卡布局不用滑動
- 17. 用兩個Viewpager和一個選項卡布局滑動問題
- 18. 在java中按下按鈕後添加選項卡
- 19. 添加菜單按鈕動作條選項卡
- 20. 將按鈕和可滾動面板添加到選項卡 - Java
- 21. 如何在XML佈局中添加選項卡和工具欄
- 22. 在片段選項卡中添加布局的問題
- 23. 在選項卡之間滑動時,指針事件被選項卡窗格上的按鈕捕獲
- 24. 使用選項卡android中的佈局 - 添加到一個選項卡的按鈕出現在所有選項卡
- 25. 動態添加選項卡
- 26. 動態添加選項卡
- 27. Android Tab選項卡布局
- 28. 佈局到選項卡TabView
- 29. Jquery EasyUI選項卡布局
- 30. 使用視圖添加按鈕佈局
是的我試過了,但滑動條的行爲發生變化,頁面無法順暢滑動! –