嗨,我对 android 编程很陌生,我正在玩include标签。
我有一个名为companylogo:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Logo Start-->
<ImageView android:src="@drawable/logo2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip"/>
</LinearLayout>
和其他名为的布局文件homepage如下所示:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" android:background="#ffffff">
<include layout="@layout/companylogo" />
</RelativeLayout>
</ScrollView>
但这不会将图像添加到homepage布局中。
我什至尝试添加android:layoutwidth/height标签。不知道我在哪里犯了错误。
提前致谢。