当我在同一个 xml 中添加微调器和文本视图时,微调器或文本视图不可见

维吉

我正在开发一个布局,其中包含以下项目

在顶部,该列表视图下水平 3 个文本视图。

如果我将列表视图设为可见,则前 3 个文本视图将被隐藏。

如果我将前 3 个文本视图设为可见,则列表视图将被隐藏。

谁能帮我让 textview 和 listview 都可见?

代码 :

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

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_gravity="top"
        android:layout_weight=".1" >

        <TextView
            android:id="@+id/day_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="sunday"
            android:gravity="center"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_weight=".1" >

        <TextView
            android:id="@+id/date_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="jun 01, 2017"
            android:gravity="center"/>

    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="50dp"
        android:layout_weight=".1" >

        <TextView
            android:id="@+id/holiday_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:text="New Yearr's day"
            android:gravity="center"/>

    </LinearLayout>

    <ListView
        android:id="@+id/list_holiday"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:divider="#999999"
        android:dividerHeight="1dp"
        android:background="@color/listbg"
        android:visibility="visible"
        android:layout_marginTop="50dp" />


</LinearLayout>
索莱曼·侯赛因

希望这能解决您的问题

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal">

        <TextView
            android:id="@+id/day_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight=".1"
            android:gravity="center"
            android:text="sunday" />

         <TextView
            android:id="@+id/date_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight=".1"
            android:gravity="center"
            android:text="jun 01, 2017" />

        <TextView
            android:id="@+id/holiday_col"
            android:layout_width="match_parent"
            android:layout_height="50dp"
            android:layout_weight=".1"
            android:gravity="center"
            android:text="New Yearr's day" />

    </LinearLayout>

    <ListView
        android:id="@+id/list_holiday"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:background="@android:color/listbg"
        android:divider="#999999"
        android:dividerHeight="1dp"
        android:visibility="visible" />

</LinearLayout>

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在同一个xml文件中设置多个按钮的设计

当我按下它时,有没有办法留在同一个芯片上?

文本在微调器中不可见

当我有一个带有两个 FK 的模型到同一个模型时解决 FK 向后关系

如果同一个标签有多个值,如何根据 XML 的内容在 SimpleXML 中编辑 XML 文件?

为什么我的文本没有出现在微调器中的图像视图中?

当我在同一个对象中有另一个元素的值时,如何访问 JSON 元素?

如何使用数据集在 Visual Basic/C# 中读取和写入同一个 XML 文件?

使用Spring在所有者对象中给同一个对象的多对多xml关系

Jaxb:在同一个程序包中解组具有多个名称空间的xml

当我在同一个pom文件中声明两个不同的版本时,哪个Maven依赖项占主导地位?

为什么当我在同一个元素上使用`* ngIf`和`* ngFor`时,`* ngFor`将空项目添加到要迭代的数组中?

当我在同一个项目中单击两次时,为什么我的复选框没有呈现?

EF Core:当我有 2 个与同一个公共表相关的不同表时,如何组织模型/表并使用 DBQuery

无法弄清楚当我去并发时如何将结果写回同一个工作表。futures

当我使用具有相同检查点的 estimator 多次预测同一个文件时,预测结果会有所不同

当我点击不同的人聊天室时,应用程序打开同一个人聊天

当我需要一个String时,R.string.XXX从strings.xml返回一个int

我正在尝试在同一个SwiftUI视图中使用两个计时器

我应该在同一个REST实体上提供不同的视图吗?

为什么我从同一个查询中得到两个不同的结果

我在 ORACLE 的同一个查询中需要 2 个计数列

如何从微调器获取当前值并将其传递给另一个活动的文本视图?

我需要一直扫描excel中的同一个Cell

我想通过触发器更新同一个表的值

(android)当我在xml布局中声明一个片段时,我无法在该片段中获取数据

android:调用notifyDataSetChanged()时微调器不更新我的视图

我可以添加同一个表的 FK 列吗?

我多次运行同一个函数时,会得到setInterval的多个实例?