android 自定义keyboardview,按钮点击区域向下偏移

<com.rollup.em1710launcher.view.NumberKeyboardView
android:id="@+id/keyboard_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:keyBackground="@drawable/bg_key"
android:keyTextColor="@color/hjjd_yellow"
android:keyTextSize="20sp"
android:shadowColor="@color/number_keyboard_press"
android:shadowRadius="0.0"
android:layout_below="@id/et_front_input_pw"
android:layout_marginTop="10dp"
android:background="#00000000"
android:layout_centerHorizontal="true"
android:verticalCorrection = "0dp"/>
</RelativeLayout>

 

如果出现偏移,请加入android:verticalCorrection = "0dp",不同系统可能有差异,有的默认不是0。浪费了一天时间的我。。。。。。。

posted @ 2022-07-20 20:36  苏小七  阅读(184)  评论(0编辑  收藏  举报