我的目的是在一行中創建許多按鈕,所以我認爲每個按鈕都必須很小。創建小按鈕
如何創建這樣的小按鈕?
我試過下面的代碼,但它不相似。
這是我style.xml
<style name="RightLink2" parent="@android:style/Widget.Button.Small">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:padding">2dip</item>
<item name="android:textSize">10dp</item>
</style>
這是我layout.xml
<LinearLayout android:layout_width="match_parent" android:id="@+id/linearLayout1" android:orientation="horizontal" android:layout_height="wrap_content" android:weightSum="1">
<Button android:id="@+id/myButton"
style="@style/RightLink2"
android:text="Click here"/>
</LinearLayout>
+1'大發膩fingers' – WarrenFaith
其更好地先給答案,然後有關的問題或建議解釋,因爲每個應用程序都有不同的REQ ..這裏是接近的答案我可以得到http://stackoverflow.com/questions/10258823/how-to-create-really-small-buttons-in-android-from-code –
+ Deepak Yadav實際上,在我看來,這是您工作的一部分,以幫助客戶完善應用程序要求。因此,不,「每個應用程序都有自己的要求」不是壞的UI設計的藉口,除非你現在是一些代碼猴,他們永遠不會與任何一種「客戶」交談,你應該開始尋找更好的工作。 <不容忍模式關閉> – Kheldar