android 自定义 theme,为Android手机制作自定义主题

我是一名新的移动开发人员,我知道如何在应用程序上放置主题,到目前为止,我已经能够制作2个移动应用程序,但我想尝试为手机制作自定义主题.我想知道是否有人对以下内容有想法.

1.how to make a customized theme for phone.

2.what is the format of the theme.

3.is it possible to make it in eclipse.

4.what are the things needed to consider to make a theme for phone.

5.how to implement customized theme on phone.

6.available tutorial on making a customized phone theme.

解决方法:

如果要更改特定主题应用程序(如GO Launcher或aHome)的主题,可以在其网站上找到链接,有关更多信息,请参阅此问题.Themes in Android?

但是,如果您想更改应用程序的主题,则可以阅读以下文档和教程:

我认为您要构建多个主题必须知道的另一种方法是为应用程序的每个主题构建一个apk,此解决方案使您的应用程序尺寸更小.像这个功能:

public static Resources getResource() {

resourcePackageName = "com.mine.MyApp";

PackageManager packageManager = mContext.getPackageManager();

Resources resources = null, resources2 = null;

try {

resources = mContext.getResources();

resources2 = packageManager

.getResourcesForApplication("com.mine.MyAppTheme");

resourcePackageName = "com.mine.MyAppTheme";

} catch (Exception e) {

Log.d("ss", e.toString());

}

if (resources2 != null)

mResource = resources2;

else

mResource = resources;

return mResource;

}

在此代码中,您的应用程序名称为com.mine.MyApp,并且您有一个包含com.mine.MyApp中所有资源的应用程序作为主题,主题apk应用程序的名称为com.mine.MyAppTheme.您可以使用多个apk作为多个主题.只需将您的资源放在主题apk文件中.您可以看到以下问题:

Writing themed applications in Android

标签:android-theme,android

来源: https://codeday.me/bug/20191122/2056435.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值