赞
踩
在应用中,实现动态切换应用图标:
activity_main.xml:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout 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:orientation="vertical" android:layout_height="match_parent" tools:context=".Activity.MainActivity"> <Button android:layout_margin="10dp" android:id="@+id/mChangeToAndroid" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="安卓" /> <Button android:layout_margin="10dp" android:id="@+id/mChangeToUniQlo" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="开发" /> <Button android:id="@+id/mChangeToSite" android:layout_margin="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="胸部肌肉" /> <Button android:id="@+id/mChangeToRecord" android:layout_margin="10dp" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="目录" /> </LinearLayout>
MainActivity:
public class MainActivity extends AppCompatActivity implements View.OnClickListener
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。