android - 我怎样才能让我的按钮更大

标签 android android-layout button

我正在尝试增大我的按钮高度。我正在尝试膨胀该行,但它不起作用任何想法?

使用相对布局和 tablelayot 查看我更新的代码...

尝试放大行和表格布局相同的结果...

我试过 enl XML

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" 
android:layout_height="fill_parent"
android:background="@drawable/black_bg"
android:layout_centerVertical="true">    
 <TableLayout android:id="@+id/row1"
android:layout_width="fill_parent"
android:layout_height="45dip"
   android:paddingRight="5px"
   android:paddingLeft="5px"
   android:paddingTop="15px"
   android:paddingBottom="5px"
    android:layout_weight="1">
<TableRow
   android:layout_weight="1"
    android:layout_height="50dip">
    <ToggleButton android:id="@+id/btn_service_plus"
      android:layout_marginRight="4px"
      android:textColor="@android:color/white"
      android:textStyle="bold"
      android:textSize="12dip"
      android:layout_width="0dp"
      android:layout_height="fill_parent"
      android:text="1"
      android:layout_weight="1" 
      />
<Button 
      android:layout_marginLeft="4px"
      android:layout_marginRight="4px"
      android:textColor="@android:color/white"
      android:textStyle="bold"
      android:layout_width="0dp"
      android:layout_height="fill_parent"
      android:textSize="12dp"
      android:layout_weight="1"
      />

<Button 
      android:layout_marginLeft="4px"
      android:layout_marginRight="4px"
      android:textColor="@android:color/white"
      android:textStyle="bold"
      android:layout_width="0dp"
      android:layout_height="fill_parent"
      android:textSize="12dp"
      android:layout_weight="1"
      />


<ToggleButton 
  android:layout_marginLeft="4px"
      android:textColor="@android:color/white"
      android:textStyle="bold" 
      android:layout_width="0dp"
      android:layout_height="fill_parent"
      android:textSize="12dp"
      android:layout_weight="1" 
      android:background="@drawable/menu_button_layout"/>
</TableRow>

最佳答案

我可能来晚了一点,但我认为 CJBS(请参阅对 Akram 的评论)是正确的。不幸的是,我无法发表评论,所以我会将其作为答案发布(这也应该很好,因为我给出了答案)。

由于 OP 的答案已经得到解答,我将提供一个可以帮助有相同问题的人的答案:

这将使按钮文本变大:

android:textSize=""

这将使按钮高度变大:

android:height=""

这将使按钮宽度变大:

android:width=""

编辑:

在“宽度”或“高度”之前使用“分钟”可能也是一个好主意。

例子:

android:minWidth=""

关于android - 我怎样才能让我的按钮更大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9348792/

相关文章:

java - Android:如何更改日期选择器分隔线的颜色?

java - 检测可点击项目上的 throw 手势

facebook - 触发 fb :login-button with other button Javascript

android - Noob 有多个安卓问题

android - 在 Android 中制作平行四边形形状

java - 图像未显示在 Android Studio 设计选项卡上的网格布局中

java - CallBack 给出 NullPointEreException

android - 上滑屏安卓

WPF : Custom Button

Android Studio 将测试文件夹或模块添加到现有项目