首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何摆脱列表视图中奇怪的白色背景?

如何摆脱列表视图中奇怪的白色背景?
EN

Stack Overflow用户
提问于 2018-06-24 02:15:49
回答 1查看 42关注 0票数 0

我正在尝试制作我的iOS应用程序的安卓版本,但在我的列表视图和列表视图中的图像周围出现了一个奇怪的白色边框,这非常令人沮丧。这是一个截图:

下面是我的文件代码:

代码语言:javascript
复制
<?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>
EN

回答 1

Stack Overflow用户

发布于 2018-06-24 02:28:16

您可以从ListView中删除android:layout_margin="8dp",或者将相同的背景放入它的父对象中:

代码语言:javascript
复制
<?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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51003878

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档