Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position and dimension #163

Open
gaminn opened this issue Mar 6, 2020 · 0 comments
Open

Position and dimension #163

gaminn opened this issue Mar 6, 2020 · 0 comments

Comments

@gaminn
Copy link

gaminn commented Mar 6, 2020

I have this simple layout:

        <RelativeLayout
            android:layout_width="wrap_content"
            android:layout_height="300dp"
            android:background="@color/colorTransparent">
                <com.shawnlin.numberpicker.NumberPicker
                    android:id="@+id/picker"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:np_width="96dp"
                    app:np_height="270dp"
                    app:np_textSize="40dp"
                    app:np_selectedTextSize="43dp"
                    app:np_dividerThickness="0dp"
                    app:np_dividerColor="@color/colorText"
                    app:np_max="59"
                    app:np_min="0"
                    app:np_selectedTextColor="@color/colorText"
                    app:np_textColor="@color/colorText"
                    app:np_wheelItemCount="3"
                    app:np_value="3"
                    app:np_maxFlingVelocityCoefficient="2" />
        </RelativeLayout>

It NumberPicker sitting inside 300dp high RelativeLayout. The RelativeLayout has some background to visualize space it occupies. With this layout, the NumberPicker is drawn in a way that it is missing half of the upper digit (it is drawn outside the RelativeLayout). I can only fix that by adding some top margin to NumberPicker which is a workaround. Is that a bug?

Also I have a hard time to understand np_width and np_height. Why are they another width and height attributes if we already have android:layout_width and android:layout_height?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant