1
A
回答
1
您可以使用的FrameLayout作爲這樣的容器:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:background="#ccc"
android:orientation="vertical">
<!--MARGIN WILL BE HALF OF HEIGHT OF FAB-->
<RelativeLayout
android:id="@+id/relative2"
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="bottom"
android:layout_marginBottom="25dp"
android:background="@color/colorPrimary"></RelativeLayout>
<View
android:id="@+id/view1"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_gravity="bottom|center_horizontal"
android:background="@color/colorAccent" />
</FrameLayout>
</LinearLayout>
相關問題
- 1. 在Windows中處理文件就像在Mac上一樣
- 2. 對於像iOS一樣的iOS CoordinatorLayout
- 3. 在facebook牆上放置一個鏈接就像是一樣嗎?
- 4. 如何在Subversion中執行「劫持」,就像在ClearCase中一樣?
- 5. 在Specman中減少列表,就像在Python中一樣
- 6. 查看網站,就好像在Mac上一樣
- 7. 使用Jquery創建滑動動畫,就像在Flusta.com上一樣
- 8. Notepad ++在Sift + Enter下面插入Line就像在Eclipse中一樣?
- 9. 在構建時就像在VS2010中包含HTML一樣
- 10. 如何讓MouseLeftButtonDown在TreeViewItem上工作,就像它在TextBlock上工作一樣?
- 11. 在全局搜索工具上工作 - 就像在MAC上一樣
- 12. 在mongoose Model上定義方法,就像在Schema上做的一樣?
- 13. 如何在iPad上使用Python,就像我在PC上工作一樣?
- 14. CoordinatorLayout&RelativeLayout屏幕空間差異
- 15. 如何在VB.NET中浮動一個控件,就像在CSS中一樣
- 16. IoC with ASMX就像你可以在WCF中一樣?
- 17. Django在API中就像+ reactjs一樣。如何生成CSRF令牌
- 18. 就像在Windows 7中一樣最小化應用程序
- 19. 在JavaScript中編碼url,就像asp.net的UrlEncode方法一樣
- 20. Jetson TX1如何在Max Performance中運行,就像Jetson TK1一樣?
- 21. ImageFigure()構造函數存在於graphiti.js中,就像draw2d一樣嗎?
- 22. 如何在Powershell中運行C++程序,就像CMD一樣?
- 23. 同時使用input()和print()(就像在聊天中一樣)
- 24. NfcV - 如何獲得HistoricalBytes,就像在NfcA中一樣?
- 25. FAB Button在ActionBar上使用
- 26. 就像在ActiveDirectory中
- 27. Stackoverflow就像Url with Rails一樣
- 28. 序列化爲AMF就像NetConnection一樣
- 29. 如何使FAB按鈕的形狀像三角形一樣
- 30. 在iOS App中打開iTunes Store,就像在twitter音樂中一樣