我使用這個Layout將兩個ImageView放在一個接一個旁邊,但這兩個圖像似乎被1個透明像素空間分開。
藍色的背景是在那裏能夠更方便地觀察問題...
兩個ImageView之間的多餘空間android
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#0000FF">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="5dip">
<ImageView
android:src="@drawable/i_position_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<ImageView
android:src="@drawable/i_position_seekbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
的是名爲.java:
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.main);
}
}
進出口使用的設備與Android 2.2。
我不能在2.1模擬器上重現2.1-update1仿真器上的毛刺...
我檢查過圖像,並且沒有額外的像素。
另外我試圖在圖像上分別添加一個紅色的1px寬邊框,毛刺仍然存在,所以圖像似乎不是問題。
這是有問題的圖像(這裏顯示正確):
http://dl.dropbox.com/u/7024937/i_position_icon.png
http://dl.dropbox.com/u/7024937/i_position_seekbar.png
這是我在我的設備看到:
感謝。
請讓我們知道您的SDK版本。 – 2011-02-17 10:10:43
Im使用Android 2.2的設備。我無法在2.1模擬器上重現2.1-update1仿真器上的故障。 – Gero 2011-02-17 10:20:46