조회 수 11660 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

이 글에서는 Qt로 작성된 안드로이드 응용프로그램에 Splash Screen을 추가하는 간단한 예를 설명한다.

 

Qt/QML에서 스플래시 화면을 작성하는 한 가지 옵션은 QML 또는 C++로 코드를 작성하는 것이다. 그러나 이 방법의 단점은 애플리케이션이 완전히 로드 될 때까지 검은색 화면을 보게된다.

 

스플래시 화면은 Android 에코 시스템을 사용하는 애플리케이션, 즉 매니페스트를 통해 애플리케이션에 추가된다. 따라서 매니페스트를 통해 Java를 사용하여 스플래시 화면을 보여줘야한다.

 

그럼 스플래시를 만들어 보자.

 

먼저 Projects > Build Settings 에서 Create Templates를 클릭한다.

templates.png

 

 

Finish를 클릭하여 프로젝트에 템플릿 추가를 완료한다.

template_wizard.png

 

추가된 AndroidManifest.xml 을 열고 다음과 같이 수정해야한다.

 

AndroidManifest.xml

애플리케이션 테마의 리소스 파일 (apptheme.xml)을 지정해야하는 매니페스트를 수정한다.

<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" 
          android:theme="@style/AppTheme" 
          android:name="org.qtproject.qt5.android.bindings.QtActivity" 
          android:label="-- %%INSERT_APP_NAME%% --" 
          android:screenOrientation="unspecified" 
          android:launchMode="singleTop">

 

다음으로 스플래시 화면 파일에 대한 정보를 추가한다.

<!-- Splash screen -->
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splash"/>
<!-- Splash screen -->

 

 

다음으로 스플래시 및 테마파일을 추가해준다. 이 파일들은 res/values ​​및 res/drawable 디렉토리에 추가되어야 한다.

 

splash.xml

new_splash.png

 

스플래시 화면에는 응용 프로그램 아이콘이 있으며 drawable 디렉토리에도 있어야한다.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="rectangle" >
            <solid android:color="#FFFFFFFF"/>
        </shape>
    </item>
    <item>
         <bitmap android:src="@drawable/icon"
        android:gravity="center" />
    </item>
</layer-list>

 

 

apptheme.xml

new_apptheme.png

 

여기서 제목 표시 줄을 비활성화하고 응용 프로그램 창의 배경을 설정한다.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Light.NoActionBar">
        <item name="android:windowBackground">@drawable/splash</item>
    </style>
</resources>

 

프로젝트를 빌드하고 안드로이드 장치에 배포하면 스플래시 화면을 볼 수 있다.

android_splash.gif

 

다음 글을 참고: https://evileg.com/en/post/596/


  1. No Image notice

    Qt프로그래밍(QtQuick) Beginner를 위한 글 읽는 순서

    Date2019.01.05 CategoryQML and Qt Quick By운영자 Views437420
    read more
  2. No Image

    QThread 소개 및 예제

    Date2019.12.25 CategoryC++ Class Bymakersweb Views29027
    Read More
  3. ApplicationWindow 와 메뉴바(MenuBar)구성

    Date2020.01.04 CategoryQML and Qt Quick Bymakersweb Views15305
    Read More
  4. No Image

    Qt 멀티 스레드 프로그래밍 시 유의해야 할 몇 가지

    Date2020.01.13 CategoryGeneral and Desktop Bymakersweb Views13811
    Read More
  5. No Image

    Qt로 XML 파싱 : Qt 6에서 업데이트된 (Parsing XML with Qt: Updates for Qt 6)

    Date2020.01.16 CategoryQt 6 Byj2doll Views21373
    Read More
  6. No Image

    2020년에 변경되는 Qt 오퍼 (Qt offering changes 2020)

    Date2020.01.31 CategoryGeneral and Desktop Byj2doll Views15310
    Read More
  7. QOpenGLWidget 을 투명하게 적용

    Date2020.02.05 CategoryGeneral and Desktop Bymakersweb Views9250
    Read More
  8. 라즈베리파이4에 대한 Qt 5.14.1 크로스컴파일

    Date2020.02.12 CategoryMobile and Embedded Bymakersweb Views13119
    Read More
  9. No Image

    QLabel의 텍스트 색과 배경색을 변경

    Date2020.02.25 CategoryC++ Class Bymakersweb Views15534
    Read More
  10. Qt로 작성된 안드로이드 APP에 Splash Screen을 추가

    Date2020.03.10 CategoryMobile and Embedded Bymakersweb Views11660
    Read More
  11. No Image

    컨테이너 클래스 - QVector

    Date2020.03.17 CategoryC++ Class Bymakersweb Views10618
    Read More
  12. 콘솔에서 사용자 입력받기

    Date2020.03.22 CategoryGeneral and Desktop Bymakersweb Views60400
    Read More
  13. No Image

    Qt 5.15 및 Qt 6의 출시 일정

    Date2020.04.09 CategoryQt 6 Bymakersweb Views10840
    Read More
  14. No Image

    재진입(Reentrancy) 및 스레드 안전성(Thread-Safety)

    Date2020.04.19 CategoryC++ Class Bymakersweb Views11127
    Read More
  15. Qt기반의 서버와 클라이언트간 SOAP(Simple Object Access Protocol)

    Date2020.05.11 CategoryGeneral and Desktop Bymakersweb Views13835
    Read More
  16. ShaderEffect QML Type을 이용한 버튼 클릭 효과

    Date2020.05.22 CategoryQML and Qt Quick Bymakersweb Views9917
    Read More
  17. Embedded Linux 에서 Qt 및 Graphics Stack

    Date2020.05.27 By운영자 Views8432
    Read More
  18. Qt MQTT 에 대해서

    Date2020.06.02 CategoryMobile and Embedded Bymakersweb Views11763
    Read More
  19. 최초의 Qt 6.0 스냅샷 제공 (First Qt 6.0 Snapshot Available)

    Date2020.06.21 CategoryQt 6 Byj2doll Views12230
    Read More
  20. No Image

    Qt로 데이터를 직렬화(serialization)하는 방법

    Date2020.08.04 CategoryC++ Class Bymakersweb Views8713
    Read More
  21. UI 폼(Form)작성 시 탭 순서(Tab Order) 설정

    Date2020.08.24 CategoryGeneral and Desktop Bymakersweb Views14450
    Read More
Board Pagination Prev 1 4 5 6 7 8 9 Next
/ 9