0

我想在我的 android 应用程序中实现主题功能。当用户选择特定主题时,我想在我的 android 应用程序中应用主题。

我在我的 android 应用程序中使用了很多图像。当用户选择主题时,如何动态更改这些图像?

4

1 回答 1

0

最简单的方法是为图像标题和 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};

然后你可以在代码中使用它们。

于 2012-02-24T06:27:34.123 回答