NumberPicker在对话框呈现不正确 [英] NumberPicker rendered incorrectly in a Dialog

查看:305
本文介绍了NumberPicker在对话框呈现不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个AlertDialog内NumberPicker实例是这样的:最后NumberPicker NP =新NumberPicker(PiattoActivity.this);

I have a NumberPicker inside an AlertDialog instantiated like this: final NumberPicker np = new NumberPicker(PiattoActivity.this);.

的问题是,代替正在呈现这样的(左侧):

The problem is, instead of being rendered like this (on the left):

它呈现的是这样的:

为什么分频器占用所有给出的空间?我怎样才能解决这个问题?

Why the dividers take up all the space given? How can I fix it?

推荐答案

您正在使用机械臂

android:layout_width="match_parent"

您应该使用

    android:layout_width="wrap_content"
    android:layout_gravity="center"

这篇关于NumberPicker在对话框呈现不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆