打开故事板时,XCode 9 GM Candidate 1正在崩溃.
ProductBuildVersion:9A235
UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Could not find class named UIImage
UserInfo: (null)
Hints:
0: Replacement view is installing: <IBStoryboardCanvasViewController: 0x7fdf6d7f7d70 representing: (null)>
Run Code Online (Sandbox Code Playgroud) 我正在做一些练习来学习 android 编程。
我希望这个水平布局中的每个按钮都是全宽的。
所以用户可以滚动它。
这是我的 xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="140dp">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button1" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="0"
android:text="Button2" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button3" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button4" />
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Button5" />
</LinearLayout>
</HorizontalScrollView>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)
所以按钮 1 和其他所有按钮都必须在画廊中滚动行