我得到了所有已安装应用程序的列表以及详细信息(app_name、app package_name、app_icon)。
我附上了截图,其中显示了我仍然面临的问题。
这是我的代码
App List Cell_layout XML,在 XMl 中我也设置了 imageView scalType 但它不起作用。
所以那些是已经安装的应用程序的图标!现在只需为 imageView 固定大小 (~50dp,~50dp) 而不是 wrap_content 制作你的应用程序列表 Cell_layout XML
现在做这个!现在应该可以解决问题了!
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|top"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/_10sdp">
<ImageView
android:id="@+id/ivAppIcon"
android:layout_width="35dp"
android:layout_height="35dp"
android:src="@mipmap/ic_launcher" />
<TextView
android:id="@+id/tvAppLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="@dimen/_5sdp"
android:ellipsize="end"
android:lines="1"
android:maxEms="10"
android:text="--"
android:textColor="@color/colorWhite" />
</LinearLayout>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句