android bootstrap功能,整合QMUI Android和Android-Bootstrap

我的手机是Android 6,版本比较低,所以整合有些问题

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

configurations.all{

resolutionStrategy{

//使用QMUI

force"com.android.support:recyclerview-v7:23.1.1"

force"com.android.support:design:23.1.1"

force"com.android.support:support-vector-drawable:24.1.1"

}

}

dependencies{

compilefileTree(include:['*.jar'],dir:'libs')

/*androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {

exclude group: 'com.android.support', module: 'support-annotations'

})*/

//注意这个地方

//testCompile 'junit:junit:4.12'

compile'com.android.support:appcompat-v7:23.0.1'

compile'com.android.support.constraint:constraint-layout:1.0.2'

//使用QMUI

compile'com.qmuiteam:qmui:1.1.7'

//使用Android-Bootstrap

compile'com.beardedhen:androidbootstrap:2.0.1'

//compile 'com.android.support:design:23.0.1'

compile'com.shamanland:fonticon:0.1.8'

compilefiles('libs/EventBus2.4.jar')

compile'com.squareup.okhttp3:okhttp:3.11.0'

//ButterKnife使用详解

compile'com.jakewharton:butterknife:8.4.0'

annotationProcessor'com.jakewharton:butterknife-compiler:8.4.0'

}

QMUI Android

编译启动的时候碰到错误:No resource found that matches the given name ‘@style/Widget.AppCompat.ImageButton’.

因为没有这个样式,所以报错

在style.xml定义

1

2

3

AndroidManifest.xml 定义主题

1

android:theme="@style/QMUI.Compat"

但有些地方是说:ctl+点 android:theme,然后进入style.xml,修改相应Theme的parent;

1)、添加包

2、在aseets中添加font awesome-webfont.ttf文件,直接复制项目里面的aseets文件夹过去

3、在Application–>oncreate()中添加:

TypefaceProvider.registerDefaultIconSets();

4、然后布局里就可以使用bootstrap了。例如添加一个TextView

android:layout_width=”wrap_content”

android:layout_height=”wrap_content”

bootstrap:bootstrapBrand=”success”

bootstrap:fontAwesomeIcon=”fa_thumbs_o_up”/>

注意别忘记添加命名空间:xmlns:bootstrap=”http://schemas.android.com/apk/res-auto”

Bootstrap:fontAwesomeIcon=”fa_thumbs_o_up”的值需要在string.xml中提前定义好.

复制value文件夹过去,但是color.xml不能覆盖,应该合并

Icon的选择可以在http://fortawesome.github.io/Font-Awesome/cheatsheet/里找到

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值