帮忙看一下我设置layout_gravity哪出现问题了。
<Button
android:id="@+id/test_button"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="test"
android:textSize="25sp" />
但是center没有实现任何事件,而且eclipse也没用在下拉菜单显示。
不知道哪出问题了?
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/test_button"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="test"
android:textSize="25sp" />
</LinearLayout?
android:layout_gravity位于LinearLayout.LayoutParams
因此在LinearLayout中使用。
或者这样改也可以:
<Button
android:id="@+id/test_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="test"
android:textSize="25sp" />
没有问题,如果是代码没有出现下拉提示,一般是Eclipse二逼了,重启或者try Android Studio
没什么问题吧 重启Eclipse如果无效可能是ADT或者 Eclipse版本太低