Kar*_*tik 11 eclipse android android-layout
在布局的图形视图中,当我从下图所示的按钮中选择API 15或更低时,环绕按钮中的文本看起来很好.
当我选择API 17时,即使xml代码相同,文本也会被替换.更改按钮填充没有帮助.
这只是Eclipse的一个问题,还是有可能新版本的android可能会看到这个移位的文本?
解决这个问题的解决方法是什么?
XML代码:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".HomeActivity" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_margin="3dp" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:src="@drawable/label" />
</LinearLayout>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/linearLayout1"
android:layout_below="@+id/linearLayout1"
android:layout_marginTop="20dp"
android:text="@string/about_title"
android:textSize="20sp" />
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_alignRight="@+id/linearLayout1"
android:layout_below="@+id/textView1"
android:layout_marginTop="5dp"
android:text="@string/temp" />
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView2"
android:layout_alignRight="@+id/textView2"
android:layout_below="@+id/textView2"
android:layout_marginTop="20dp"
android:baselineAligned="false" >
<Button
android:id="@+id/button1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/news" />
<Button
android:id="@+id/button2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/tournaments" />
<Button
android:id="@+id/button3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/results" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
Kar*_*tik 10
android:gravity="center"
没有帮助
我重启了两次日食.奇怪的是,它在第一次重启时没有帮助,但在第二次重启后看起来很好.此外,它在设备上工作正常.对于这个问题道歉,我必须在发布问题之前等待.
归档时间: |
|
查看次数: |
5480 次 |
最近记录: |