LinearLayout에 래핑 된 EditText 컨트롤 옆에 Button이 있습니다. 단추가 EditText보다 훨씬 높다는 것과 그 높이가 같기를 바랍니다. @ drawable/main_edittext와 @ drawable/main_edittext_button의 높이는 같지만 배경이 설정되지 않은 경우에도 높이는 다릅니다. 응용 프로그램 매니페스트 파일에서 응용 프로그램 테마는 windowNoTitle = true로만 설정됩니다.EditText 및 Button 높이 문제
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:background="@drawable/main_background"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<EditText
android:id="@+id/edit_message"
style="@style/MainEditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/edit_message"
android:singleLine="true" />
<Button
android:id="@+id/edit_message_button"
style="@style/MainSearchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="sendMessage"
android:text="@string/button_send" />
</LinearLayout>
<style name="MainEditText">
<item name="android:background">@drawable/main_edittext</item>
<item name="android:textSize">16sp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#262626</item>
</style>
<style name="MainSearchButton">
<item name="android:background">@drawable/main_edittext_button</item>
<item name="android:textSize">16sp</item>
<item name="android:textStyle">normal</item>
<item name="android:textColor">#ff5500</item>
</style>
+ main_edittext.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/edit_text">
</item>
<item
android:state_enabled="true"
android:state_focused="true"
android:drawable="@drawable/edit_text">
</item>
<item android:state_enabled="true"
android:drawable="@drawable/edit_text">
</item>
</selector>
-main_edittext.xml
+ main_edittext_button.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_pressed="true"
android:drawable="@drawable/edit_text_button">
</item>
<item
android:state_focused="true"
android:drawable="@drawable/edit_text_button">
</item>
<item android:drawable="@drawable/edit_text_button" />
</selector>
-main_edittext_button.xml
Android 플랫폼 버전에 따라 고유 한 패딩이 있습니다. 확인을 위해 출처를 확인하십시오. https://github.com/android/platform_frameworks_base/tree/master/core/res/res/values – Blundell