android - CheckBox 被夹在平板电脑中

标签 android checkbox clipped

我有这样的布局:

<LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"
      android:layout_marginBottom="10dp"
      android:gravity="center_vertical" 
      android:layout_marginLeft="10dp">

      <CheckBox 
              android:id="@+id/screen_login_checkbox"
              android:button="@drawable/login_screen_checkbox_image_selector"
              android:layout_width="wrap_content"             
              android:layout_height="wrap_content"/>

      <TextView 
              android:layout_width="wrap_content"
              android:layout_marginLeft="10dp"
              android:text="@string/screen_login_checkboxLabel"
              android:layout_alignBaseline="@id/screen_login_checkbox"
              android:textColor="@color/black" 
              android:textSize="@dimen/screen_login_check_text"
              android:layout_height="wrap_content"/>
</LinearLayout>

问题是这在智能手机上有效,但在平板电脑上无法正常工作。在平板电脑上,CheckBox 在右侧被夹住,我不知道为什么。

有人知道如何解决这个问题吗?

最佳答案

尝试将 android:paddingRight 添加到您的 CheckBox。如果您使用 dp 而不是 px 作为填充值来添加填充

,它应该也适用于表格和小屏幕

关于android - CheckBox 被夹在平板电脑中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8416836/

相关文章:

android - 在 Android 的 SurfaceView 中使计算和绘图独立于 CPU 速度

javascript - 如果未选中复选框,则禁用表单提交

swiftui - Clipped 并不是在 SwiftUI 中实际剪辑图像

android - Android 上的 Youtube API Player 每 2 秒自动暂停一次

java - 如何在 onClick 事件和 Activity 更改后将 textView 设置为可见?

list - 将多个复选框绑定(bind)到 Grails 中的列表

ios - UICollectionView 中的最后一个单元格被剪裁

java - 以编程方式从布局中删除 <include view/> 并释放空间

java - 当客户端连接时将 JCheckBox 包含在 JFrame 中