私はこのようにコーディングしようとしました
<ImageView android:id="@+id/ivIcon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/ic_btn_speak_now" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item0" />
しかし、それはこのように出力されます。それは同じ行にありません:(
私のxmlコード全体はこのようなものです。
(icon) item
アクティビティに移動するためにユーザーがクリックするセットになります。
したがって、それらをグループ化する必要があります。
<LinearLayout style="@style/behindMenuScrollContent"
android:paddingTop="25dp" >
<TextView
style="@style/behindMenuItemTitle"
android:text="Subject" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item0" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item1" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item2" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item3" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item4" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item5" />
<TextView
style="@style/behindMenuItemTitle"
android:text="Subject2" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item6" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item7" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item8" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item9" />
<TextView
style="@style/behindMenuItemLabel"
android:text="Item10" />
<Button
android:id="@+id/behind_btn"
style="@style/behindMenuItemLabel"
android:text="BUTTON" />
</LinearLayout>
更新: アイコンとテキストの間の余白は必要ありませんが、左だけに余白が必要です!
style.xml
<style name="behindMenuItemLabel">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginLeft">20dp</item>
<item name="android:layout_marginBottom">4dp</item>
<item name="android:textSize">30sp</item>
<item name="android:textColor">#d2d2d2</item>
</style>