任意UI組件都到不了邊界

  各個組件都到不了屏幕邊界,主要是父類容器,可能有margin,padding.等,要向父類容器檢查,直到最底層容器.


問題xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"    //問題
    android:paddingLeft="@dimen/activity_horizontal_margin"     //問題
    android:paddingRight="@dimen/activity_horizontal_margin"  //問題
    android:paddingTop="@dimen/activity_vertical_margin"         //問題
    tools:context=".MainActivity" >
    
    <android.support.v4.view.ViewPager
        android:id="@+id/vep_1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
         >
    </android.support.v4.view.ViewPager>

</RelativeLayout>

  在上述佈局中添加任何組件都無法到達屏幕邊界


修改完成,將問題刪除即可.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
    
    <android.support.v4.view.ViewPager
        android:id="@+id/vep_1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
         >
    </android.support.v4.view.ViewPager>

</RelativeLayout>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章