Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在我的 android 应用程序中实现主题功能。当用户选择特定主题时,我想在我的 android 应用程序中应用主题。
我在我的 android 应用程序中使用了很多图像。当用户选择主题时,如何动态更改这些图像?
最简单的方法是为图像标题和 ID 创建一个数组,例如:
private static final String[] TITLES = {"Image 1", "Image 2", "Image 3"}; private static final int[] RESIDS = {R.drawable.image1, R.drawable.image2, R.drawable.image3};
然后你可以在代码中使用它们。