2016-11-02 4 views

答えて

4

必要なのは、(Theme.myTheme)

<resources> 
<style name="Theme.myTheme" parent="@style/Theme.AppCompat.NoActionBar"> 
    <item name="android:buttonStyle">@style/customButton</item> 
</style> 

<style name="customButton" parent="Widget.AppCompat.Button"> 
    <item name="android:textAllCaps">false</item> 
</style>  

がマニフェストにAndroidのテーマを追加 /app/platform/android/res/values.xmlの下でアンドロイドの値を定義することです。

<android xmlns:android="http://schemas.android.com/apk/res/android"> 
    <manifest> 
     <supports-screens android:anyDensity="false" 
      android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/> 
     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 
     <uses-permission android:name="android.permission.CAMERA"/> 
     <uses-feature android:name="android.hardware.camera"/> 
     <uses-feature android:name="android.hardware.camera.autofocus"/> 
     <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/> 
     <application android:debuggable="true" 
      android:icon="@drawable/appicon" 
      android:largeHeap="true" android:theme="@style/Theme.myTheme"> 
      <activity 
       android:configChanges="keyboardHidden|orientation|screenSize" android:name="org.appcelerator.titanium.TiActivity"/> 
     </application> 
    </manifest> 
</android> 
0

なぜボタンを使用する必要があり、システムのデフォルトレイアウトに依存しますか?

代わりにビューを使用して、クリックイベントを聞くことができます。

ビューのスタイルを自由に変えることができ、異なるプラットフォーム間で同じように表示されます。

+0

私は既にコードを書いています。だれかがデフォルト値をどこかで変更したので、コードをすべて変更したくないと思います。 – bharal

+0

特にAndroid OSのアップデートでは、アラートダイアログ、ボタン、スイッチ、日付選択ツールなどの一部のコンポーネントのデフォルト動作を変更することは避けられません。可能な場合は、変更しないコンポーネント(ビュー、ラベルなど)を使用できます。 – fahad86

関連する問題