[英]How to remove space around an android TimePicker
我无法删除TimePicker周围的空间:我正在将TimePicker缩小至40%,但TimePicker周围有很多空间,无法删除。
我正在使用translationX和translationY定位TimePicker。
请在下面的xml(布局)代码中找到:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="vertical" >
<TimePicker
android:id="@+id/timePicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scaleX="0.4"
android:scaleY="0.4"
android:translationX="-60dp"
android:translationY="-20dp"
android:background="#FFDDAA00" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Below the time spinner" />
</LinearLayout>
请在模拟器的屏幕截图下方找到: http : //www.pixentral.com/show.php? picture= 1T9y7rt22pzeDwounqG6i5z9YgRMYA
如您所见,TimePicker和下面的文本之间的间隙是我无法删除的空间。 我设置了TimePicker的背景,以突出显示实际的TimePicker及其周围的空间。
尝试类似-
android:layout_marginTop="-10dp"
和
android:layout_marginLeft="-10dp"
根据您的要求降低价值。
编辑:
尝试从活动中删除填充和边距。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.