下面是显示数量布局的代码。其实很简单,就是帧布局嵌套帧布局就好了。 <LinearLayout android:id="@+id/ft_fragment_home_accept_layout" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="1" android:gravity="center" android:orientation="vertical" android:paddingBottom="15dp" > <FrameLayout android:layout_width="48dp" android:layout_height="58dp" android:layout_marginTop="10dp"> <ImageView android:layout_width="50dp" android:layout_height="50dp" android:scaleType="center" android:src="@mipmap/home_dd" android:layout_gravity="center" /> <FrameLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right"> <ImageView android:id="@+id/ft_fragment_home_accept_number_img" android:layout_gravity=&
android仿qq微信的消息数量显示功能
最新推荐文章于 2021-05-28 06:04:56 发布
本文介绍了如何在Android中仿照QQ和微信实现消息数量显示功能。通过使用帧布局嵌套帧布局,结合动态控制数量的显示和不同数量位数的背景显示,详细展示了代码实现逻辑,包括设置TextView和ImageView来展示消息计数,并根据数量调整图片资源。
摘要由CSDN通过智能技术生成