c# - 下拉菜单的 textView 位置
问题描述
Xamarin Android
我正在尝试制作下拉菜单。我不知道,我做错了什么。
我不能像我想要的那样定位 textView。视图应位于屏幕顶部。然而,它在底部。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:minWidth="25px"
android:minHeight="25px"
android:background="#f2f2f2">
<RelativeLayout
android:id="@+id/productTitleBar"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="55dp"
android:background="#ff46a1e1">
<TextView
android:id="@+id/txtProductTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"
android:text="Product List"
android:layout_gravity="center"
android:clickable="true"
android:layout_centerVertical="true"
android:textSize="18dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
<TextView
android:id="@+id/txtDescription"
android:layout_width="match_parent"
android:layout_height="100dp"
android:textColor="#000000"
android:text="Desription goes here"
android:layout_gravity="center"
android:clickable="true"
android:textSize="18dp"
android:layout_above="@+id/btnImgExpander"
android:background="#FFFFFF"
android:gravity="center"
android:visibility="gone" />
<ImageView
android:id="@+id/btnImgExpander"
android:layout_alignParentBottom="true"
android:layout_height="30dp"
android:layout_width="match_parent"
android:src="@drawable/up_arrow"
android:background="#fff2f2f2" />
<ListView
android:id="@+id/productListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="55dp"
android:layout_marginBottom="30dp"
android:background="@android:color/background_light"
android:fastScrollEnabled="true" />
</RelativeLayout>
我有
我想
有人可以帮我解决这个问题吗?
解决方案
android:layout_above="@+id/btnImgExpander"
在 TextView 上android:layout_alignParentBottom="true"
设置,但在 ImageView 上设置,将其与容器底部(外部 RelativeLayout)对齐。您可以尝试:android:layout_alignParentTop="true"
并删除android:layout_alignParentBottom="true"
推荐阅读
- python - 循环列表两次以查找第一个循环和第二个循环的第二个索引和第一个索引
- python - 将具有不同大小的列表字典转换为 df
- ios - Swift decodable 无法访问数组中的嵌套数据
- java - 获取多个字符串数组并将其写入单行打印
- ruby-on-rails - Rails:在视图中创建一个简单的计时器
- angular-ui-grid - 是否可以从角度 ui-grid 中删除一行标题列?
- python - AttributeError: 'English' 对象没有属性 'noun_chunks
- hyperledger-fabric - 如何以组织的身份拒绝背书交易
- php - 如何根据会话变量 php 显示项目
- installation - ubuntu 中的“flutter:找不到命令”