2012-06-29 39 views
2

如何在Android屏幕上部分放置視圖?需要滑入的視圖放置在RelativeLayout中,現在是整個佈局文件。在Android屏幕上部分定位視圖

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 

    <WebView 
     android:id="@+id/webViewLink" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"/> 
    <WebView 
     android:id="@+id/webView" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"/> 
</RelativeLayout> 

第二個webview是需要部分在屏幕之外的webview。

+0

你試過'android:layout_marginRight =「 - 30dp」'? – Wesley

回答

0

您可以使用android:layout_marginRight="-30dp"作爲@ user1490103建議。或者你可以使用android:translationX。如果您計劃對此視圖進行動畫製作,翻譯將更有意義。請記住在RelativeLayout上的setandroid:clipChilren="false"

相關問題