とのトラブル私はここでトップの答えに苦しんだ:私はGradleのでは@spierce7模倣材料設計上げボタンのスタイル、StackOverflowのソリューション
- によって記載されている最低限必要とモックプログラムを作っHow to mimic the Material-design raised button style, even for pre-Lollipop (minus the special effects)?
:(私の場合は24.2.1)
compile "com.android.support:appcompat-v7:24.1.1"
//のstyles.xmlで - :Androidのマニフェストに
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
- :
android:theme="@style/AppTheme"
- My活動は私のボタンが
AppCompatButton
あるAppCompatActivity
- (またはプレーン
Button
、重要ではありません)拡張
ここでは、レイアウトXMLです:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:showIn="@layout/activity_main">
<android.support.v7.widget.AppCompatTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:id="@+id/textview_helloworld"/>
<android.support.v7.widget.AppCompatButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button"
android:layout_below="@id/textview_helloworld"/>
</RelativeLayout>
結果がこれです:
コーナー浮動bu ttonは「盛り上がった外観」で膨張しますが、私のAppCompatButtonは膨張しません。
さらに、私はまだロリポップ前のボタンを見ることができません。何が欠けているのか、間違っているのですか?
appcompatボタンにある程度の高さを置いてください。 –
Android 4.4には標高がありません。それは5.0で追加されました – spierce7