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

 2023-11-11 阅读 27 评论 0

摘要:我的手機是Android 6,版本比較低,所以整合有些問題1Android Studio Plugins、234android 開發工具?567android studio linearlayout?8910qt android開發。111213141516171819202122232425262728293031configurations.all{resolutionStrategy{//使用QMUIforce&

我的手機是Android 6,版本比較低,所以整合有些問題

1

Android Studio Plugins、2

3

4

android 開發工具?5

6

7

android studio linearlayout?8

9

10

qt android開發。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/里找到

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/3/170593.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息