小编use*_*885的帖子

多次包含相同的布局

我有一个共同的布局(common.xml),我希望在另一个布局(layout_a.xml)中包含很多次.但它只给我看了一次.为什么?

common.xml

<merge xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:background="@android:drawable/alert_light_frame">

        <ImageView

            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:id="@+id/imageView"

            android:src="@drawable/test"

            android:scaleType="centerCrop" />

        <TextView

            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:layout_below="@+id/imageView"
            android:id="@+id/textView"
            android:text="test"
            android:layout_marginTop="10dp"
            android:layout_marginRight="10dp"
            android:layout_marginLeft="10dp" />
    </RelativeLayout>
</merge>
Run Code Online (Sandbox Code Playgroud)

layout_a.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/common" />

    <include layout="@layout/common" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

android android-layout

11
推荐指数
2
解决办法
7804
查看次数

android studio - 自动删除未使用的资源

Android lint工具似乎只能检测未使用的资源,但会删除这些资源.有没有办法自动删除这些未使用的资源?

android-studio

5
推荐指数
1
解决办法
3196
查看次数

java unbound wildcard <?> vs <T>

I am confusing that if the following method are same? Are there any subtle differences?

Your advice are very appreciated.

method 1

public static double sumOfList(List<?> list) {}
Run Code Online (Sandbox Code Playgroud)

method 2

public static <T> double sumOfList(List<T> list) {}
Run Code Online (Sandbox Code Playgroud)

java generics

4
推荐指数
1
解决办法
3815
查看次数

标签 统计

android ×1

android-layout ×1

android-studio ×1

generics ×1

java ×1