我擁有480x800分辨率和密度1.5的模擬器。因此,當我在視圖中顯示320x50分辨率的任何廣告(admob,madvertise)時,它將縮放爲480 x 75.阻止視圖中的密度縮放
這就是佈局的樣子 - 廣告視圖添加了代碼到LinearLayout(id adsholder) :
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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" >
<com.sbcgames.sbcengine.SBCGLView
android:id="@+id/sbcglview"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/adsholder"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:orientation="vertical" >
</LinearLayout>
</FrameLayout>
有沒有辦法如何防止縮放?我想保留原始像素尺寸而不是idp。我試圖加入到這個清單,但它並沒有幫助:
<supports-screens android:anyDensity="true" />
感謝您的幫助
您是否在「WebView」中顯示您的廣告? – wsanville
把大小的寬度和高度,而不是wrap_content,使用px而不是dp –
不,對於admob它是com.google.ads.AdView和Madvertise它是de.madvertise.android.sdk.MadvertiseView - 它被創建通過代碼,然後添加到我的LinearLayout包裝廣告大小。 –