我使用这种布局来制作图像和文本在center.but它不工作。我简单地使用android:layout_centerHorizontal =“true”.why它不工作我不明白。有人可以帮助解决这个问题吗?android:layout_centerHorizontal =“true”在android中不工作
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#ffffff">
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="70dp"
android:background="@drawable/image_tutorial1" />
<TextView
android:textSize="14dp"
android:id="@+id/title"
android:layout_below="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="@string/info4"
android:textColor="#000000"
android:textStyle="bold" />
</RelativeLayout>
即时通讯使用相对布局,但它不working.i也尝试linearlayout,但也不起作用 – 2013-02-23 13:17:33
它只在相对布局下工作,然后它的工作,我使用了很多次 – Rohit 2013-02-23 13:18:04
你试过主布局将linearlayout和textview将在相对布局 – Rohit 2013-02-23 13:19:29