[英]Xamarin - Visual Studio 2013: Widgets overlapping in Relative view
Using Xamarin 3.9.236 and Visual Studio 2013, I have a VERY basic project to test a layout. 使用Xamarin 3.9.236和Visual Studio 2013,我有一个非常基础的项目来测试布局。 My Layout source is as follows...
我的布局源如下...
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:text="Prev"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/buttonPrev"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true" />
<Button
android:text="Next"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/buttonNext"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" />
<ImageView
android:src="@drawable/Untitled1"
android:layout_width="160dp"
android:layout_height="160dp"
android:id="@+id/imageCourse"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp" />
<TextView
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/textTitle"
android:id="@+id/textView1"
android:gravity="center_horizontal"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp" />
<TextView
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/imageCourse"
android:layout_marginTop="10dp"
android:layout_centerHorizontal="true" />
</RelativeLayout>
But the output is not as expected. 但是输出不符合预期。 I am doing this through a PluralSight Course, but they are using a MUCH older version of Xamarin, and don't seem to be having this issue.
我正在通过PluralSight课程进行此操作,但是他们使用的是Xamarin的更旧版本,似乎没有这个问题。
Please see the following image for what I am trying to do... 请查看下图以了解我要执行的操作...
As you can see, the widget.TextView is being overlapped by widget.ImageView 如您所见,widget.TextView被widget.ImageView覆盖
Try swapping the order of the TextViews in the layout. 尝试交换布局中TextView的顺序。 Sometimes they need to be ordered correctly so it recognises the ID of the view it is supposed to be below.
有时需要正确订购它们,以便它识别应该位于其下方的视图的ID。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.