Android Bootstrap 不在按钮中显示图标

标签 android twitter-bootstrap

我实现了 Android Bootstrap 库: https://github.com/Bearded-Hen/Android-Bootstrap

一切正常,但按钮中的图标不显示。

我将 font-awesome 文件添加到 asset 文件夹中,但仍然没有成功。

如何解决?

感谢您的帮助。

最佳答案

尝试对我有用的方法,确保 libs 文件夹中的“android-support-v4.jar”文件(假设您在 eclipse 中工作)与 AndroidBootstrap 库项目和您的项目中的副本相同。 这可能只能部分解决您的问题,当您更改方向(横向/纵向)时,您可能会遇到图标不显示的问题,并且可能有更好的解决方案,但这是我的快速解决方案:

在 OnResume 添加:

if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE){

        bbYourButton1.setLeftIcon("fa-heart");
        bbYourButton2.setRightIcon("fa-twitter");
    }

关于Android Bootstrap 不在按钮中显示图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21079432/

相关文章:

android - 如何解决错误:在此范围内未声明 'vreinterpretq_u32_f64'-在Android上使用Eigen构建

android - 在锁定屏幕上显示 Dialogfragment

android - 当我通过后退按钮关闭应用程序并从任务重新启动时, Intent 数据仍然存在

html - 推特 Bootstrap 3.3.4 : navbar with right aligned dropdown menu always visible/usable

html - 更改 Bootstrap 导航链接填充而不会弄乱对齐

css - 在不同的屏幕尺寸下启用 Bootstrap 导航按钮

android - 如何在 Eclipse 中包含 Android gradle 依赖项

android - Android 方向故障?

jquery - selectpicker - 仅在选择中有更多选项时出错

html - 面板标题中的 bootstrap 3 输入组