我有以下XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Current Task"
android:id="@+id/currTask"
android:layout_marginLeft="20dp"
android:layout_marginStart="33dp"
android:layout_marginTop="20dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView4"
android:layout_below="@+id/currTask"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignLeft="@+id/currTask"
android:layout_alignStart="@+id/currTask"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Started:"
android:id="@+id/textView5"
android:layout_marginTop="25dp"
android:layout_below="@+id/textView4"
android:layout_alignLeft="@+id/currTask"
android:layout_alignStart="@+id/currTask" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Time Remaining:"
android:id="@+id/timeRemain"
android:layout_marginTop="20dp"
android:layout_below="@+id/textView5"
android:layout_alignLeft="@+id/textView5"
android:layout_alignStart="@+id/textView5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Next Task:"
android:id="@+id/txtNxt"
android:layout_centerVertical="true"
android:layout_alignLeft="@+id/timeRemain"
android:layout_alignStart="@+id/timeRemain" />
<Switch
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remind"
android:id="@+id/swtchRemind"
android:layout_alignTop="@+id/txtNxt"
android:layout_alignRight="@+id/textView4"
android:layout_alignEnd="@+id/textView4"
android:layout_marginRight="25dp"
android:layout_marginEnd="25dp"
android:layout_centerVertical="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Done"
android:id="@+id/button2"
android:layout_alignParentBottom="true"
android:layout_alignLeft="@+id/txtNxt"
android:layout_alignStart="@+id/txtNxt"
android:layout_marginBottom="25dp" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Snooze"
android:id="@+id/btnSnooze"
android:layout_alignTop="@+id/button2"
android:layout_alignLeft="@+id/swtchRemind"
android:layout_alignStart="@+id/swtchRemind" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:id="@+id/tvTimeRemaining"
android:layout_alignBaseline="@+id/timeRemain"
android:layout_alignBottom="@+id/timeRemain"
android:layout_alignRight="@+id/swtchRemind"
android:layout_alignEnd="@+id/swtchRemind" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/textView6"
android:layout_below="@+id/txtNxt"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignLeft="@+id/txtNxt"
android:layout_alignStart="@+id/txtNxt"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:text="tst"
android:layout_alignParentStart="false" />
</RelativeLayout>
现在,我遇到了textView6
的问题。 Android工作室正确呈现了这一切(它是onCreate
中充斥的标签页):textView6
位于txtNxt
之下。 但在我的手机和模拟器中(我的手机运行android 4.4.2,我已经尝试过4.4.4和4.2.2。无法将5.0的模拟器运行到加载),testView4
位于textView6
下方,位于 currTask
下方。
我已尝试删除并重新创建,我已尝试复制并粘贴textView4
并修改字段android:layout_below
。什么都行不通。
此外 - 渲染显示同一水平线上的两个按钮,但在我的手机和模拟器上,button2
略低btnSnooze
logcat:
I/System.out: debugger has settled (1381)
I/dalvikvm: Could not find method android.widget.TimePicker.getHour, referenced from method com.example.sayals.mytodo.MainActivity.AddItm
W/dalvikvm: VFY: unable to resolve virtual method 18737: Landroid/widget/TimePicker;.getHour ()I
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0012
D/dalvikvm: GC_FOR_ALLOC freed 74K, 5% free 3921K/4088K, paused 5ms, total 8ms
D/dalvikvm: GC_FOR_ALLOC freed 50K, 4% free 4372K/4512K, paused 4ms, total 7ms
I/dalvikvm-heap: Grow heap (frag case) to 6.770MB for 2536932-byte allocation
D/dalvikvm: GC_FOR_ALLOC freed 1K, 3% free 6848K/6992K, paused 4ms, total 4ms
D/libEGL: loaded /system/lib/egl/libEGL_genymotion.so
D/: HostConnection::get() New Host Connection established 0xb888d0c0, tid 1314
D/libEGL: loaded /system/lib/egl/libGLESv1_CM_genymotion.so
D/libEGL: loaded /system/lib/egl/libGLESv2_genymotion.so
W/EGL_genymotion: eglSurfaceAttrib not implemented
E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from GradienCache
E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
E/OpenGLRenderer: Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
E/OpenGLRenderer: MAX_TEXTURE_SIZE: 16384
D/OpenGLRenderer: Enabling debug mode 0
有什么想法吗?
我会注意到target SDK version
应该是19
,但是compile SDK version
是23.我已经尝试通过设置将其更改为19,但是它没有帮助,即使它编译了,我在build.gradle
处的这些行出错:
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
说他们不匹配compile SDK version
。我还没有尝试改变它们,即使它们看似相关......可能应该这样,但我猜我需要使用SDK管理器下载一些相关内容...我已经下载了一些与SDK相关的内容api等级为19的东西,但仍然说它无法解决依赖关系...