Android /スタイリングボタン:描画可能な左と描画可能な右の背後にも背景
-
03-10-2019 - |
質問
私は、さまざまなコンテンツを通じてプログラムの幅が変化する可能性があるボタンをスタイリングしています。このようなデザイナーからPNGファイルを入手しました:
[Left Border] [Background (just a strip with the gradient)] [Right Border]
このようなボタンのプロパティを割り当てるのは大丈夫だと思いました:
Background: Background.png
Drawable left: LeftBorder.png
Drawable right: RightBorder.png
しかし、それはそのようにはなりません;)今、背景の左が始まり、右の右の最後で終了する場所からbackground.pngが始まります。この場合、これらの描画可能なプロパティを正しい方法ではありませんか?
これがコードです:
<Button
android:text="@+id/Button01"
android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/top_loaction_left"
android:drawableRight="@drawable/top_loaction_right"
android:background="@drawable/top_loaction_bg"></Button>
..
解決
所属していません StackOverflow