我試圖在我的Android應用程序中使用GridLayout,我希望它從屏幕左側開始160dp。當我設置android:layout_marginLeft="160dp"
時,我發現這發生在Eclipse的GraphicalLayout選項卡中,但是當我構建應用程序時,它並不反映該邊距。marginLeft似乎並沒有在我的GridLayout上工作
我錯過了什麼嗎?
我的網格佈局代碼的其餘部分:
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/GridLayout3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="160dp"
android:columnCount="4"
android:orientation="horizontal" >
誰是此佈局的父級?你能給我們更多的細節嗎? –
我很新,所以我會分享我可以... AFAIK,這是父母。在xml文件中,這是頂層元素。 – Jeff
您是否試圖在物理Android設備而不是模擬器上排除此問題? – subv3rsion