LoginSignup
1
1

More than 5 years have passed since last update.

Titaniumでも起動画面に9-patchを使う

Posted at

ブログやマニュアルに記載されている方法だとうまくいかないのでメモ。

最初にこの方法が紹介されたブログではplatform/android/res/drawable*以下にファイルを置いて(Alloyだとapp/platform/…)、同じくplatform/android/res/valuesの下にXMLを用意することになっています。

またAppceleratorのマニュアルでもやはりカスタマイズしたテーマを用意するようになっています。

が、どちらもAPI 21以降のwindowBackgroundをつかうので、ターゲット次第ではビルド時にエラーになってしまいます。あるいは、values-v21に置いてもエラーになるので、parentが正しくないのかもしれませんね。

[ERROR] Failed to package application:
[ERROR]   
[ERROR] /Path/To/Appcelerator_Studio_Workspace/YourApp/build/android/res/values-v21/custom_theme.xml:13: error: Error: No resource found that matches the given name: attr 'windowBackground'.

というわけで、workaroundとしては、app/assets/android/とapp/assets/android/images以下のdefault.pngを全てdefault.9.pngに差し替えるという、泣きたくなるほど原始的なやり方で対応すると、うまくいきます。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1