【发布时间】:2017-05-10 13:31:16
【问题描述】:
我只是使用 xamarin 为 android 设备开发应用程序的新手。
我的问题是,与设计器屏幕相比,我在设备上的视图位置(最小和最大)不同。其他视图都在正确的位置。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/relativeLayout1">
<EditText
android:id="@+id/inputMin"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:background="#FFFFFF"
android:hint="Min"
android:textColor="#EF5350"
android:textColorHint="#EF5350"
android:padding="15dp"
android:layout_marginLeft="69dp"
android:layout_marginTop="140dp"
android:inputType="number"
android:gravity="center"
android:maxLength="5" />
<EditText
android:id="@+id/inputMax"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_toRightOf="@+id/inputMin"
android:layout_below="@+id/title"
android:background="#FFFFFF"
android:hint="Max"
android:textColor="#EF5350"
android:textColorHint="#EF5350"
android:padding="15dp"
android:layout_alignBaseline="@+id/inputMin"
android:inputType="number"
android:gravity="center"
android:maxLength="5" />
我该如何解决这个问题?
非常感谢。
问候,山姆。
【问题讨论】:
-
通常当我们使用某些布局参数时,例如
layout_below或layout_toRightOf,我们不会为现有id 添加+。例如:android:layout_below="@id/title"。如果这个问题没有解决,能否请您发布整个 xml 代码? -
它没有用。我刚刚发布了整个 xml 代码。我不知道怎么了。
标签: c# android .net xamarin view