我正在尝试制作我的iOS应用程序的安卓版本,但在我的列表视图和列表视图中的图像周围出现了一个奇怪的白色边框,这非常令人沮丧。这是一个截图:
下面是我的文件代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.leoconnelly.connexus.HealthCenterListActivity">
android:background="#D53D96"
<ListView
android:id="@+id/hospitals_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:background="#D53D96"
/>
</RelativeLayout>
发布于 2018-06-24 02:28:16
您可以从ListView
中删除android:layout_margin="8dp"
,或者将相同的背景放入它的父对象中:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#D53D96"
tools:context="com.example.leoconnelly.connexus.HealthCenterListActivity">
<ListView
android:id="@+id/hospitals_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:background="#D53D96"
/>
</RelativeLayout>
https://stackoverflow.com/questions/51003878
复制相似问题