我创建了一个支持android 2.3到最新的android操作系统的应用程序。但是我的布局有问题。这里是我的XML代码http://pastebin.com/JLHnADNu,这是Android的4 按钮显示2之间的不同高度android os
按钮显示,但这一按钮的外观不同的Android 2.3的下面是屏幕截图
我的问题是如何在实现同样的结果两个OS。谢谢。
我创建了一个支持android 2.3到最新的android操作系统的应用程序。但是我的布局有问题。这里是我的XML代码http://pastebin.com/JLHnADNu,这是Android的4 按钮显示2之间的不同高度android os
按钮显示,但这一按钮的外观不同的Android 2.3的下面是屏幕截图
我的问题是如何在实现同样的结果两个OS。谢谢。
试试这个:
<TableLayout
android:layout_width="fill_parent"
android:background="#428bca"
android:stretchColumns="*">
<TableRow>
<Button
android:id="@+id/simpan_situs"
android:textColor="#ffffff"
android:background="@android:color/transparent"
android:layout_height="50dp" //or whatever the height you want
android:text="@string/simpan"/>
<Button
android:id="@+id/gambar_situs"
android:textColor="#ffffff"
android:background="@android:color/transparent"
android:layout_height="50dp" //or whatever the height you want
android:text="@string/gambar"/>
</TableRow>
</TableLayout>
又读this
您的回答几乎是正确的,我只是为按钮“android:layout_height =”50dp“'添加了相同的高度。谢谢。 – 2014-09-19 06:04:33
尝试向按钮添加android:textSize =“30dp”,正如我在我编辑的答案 – Metehan 2014-09-19 06:06:37
你必须创建布局按照dp像hdpi -mdpi-xhdpi – 2014-09-19 05:45:15
你是否已经为Button应用了高度wrap_content? – Piyush 2014-09-19 05:47:11
@PG_Android是的,但是没有改变高度。 – 2014-09-19 06:03:14