在Android的RelativeLayout中,我们可以使用以下代码将textView精确地放置在屏幕中央:
我希望textView能够往下移动一点,我尝试添加
期望结果(稍微往下):
<TextView
android:text="This is TextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true" />
结果:
top
-
-
-
-
This is TextView (center vertical)
-
-
-
-
bottom
我希望textView能够往下移动一点,我尝试添加
marginTop
,但似乎在使用layout_centerVertical=true
后变得不可能。有解决方法吗?期望结果(稍微往下):
top
-
-
-
-
-
-
This is TextView (center vertical slight to bottom)
-
-
bottom