Try to display two wheels in one view, resulting in 1 view displayed
Opened this issue · 1 comments
GoogleCodeExporter commented
What steps will reproduce the problem?
1. modify date_layout.xml to have 2 sets of wheel elements in list layout as
below.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="300dp"
android:layout_width="fill_parent"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:background="@drawable/layout_bg">
<TextView android:id="@+id/s_date" android:text="Start Date" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="70dp"
android:layout_width="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:id="@+id/start_date_wheel">
<widget.WheelView android:id="@+id/start_day"
android:layout_height="wrap_content"
android:layout_width="46dp"/>
<widget.WheelView android:id="@+id/start_month"
android:layout_height="wrap_content"
android:layout_width="100dp"/>
<widget.WheelView android:id="@+id/start_year"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
<TextView android:id="@+id/e_date" android:text="End Date" android:layout_width="wrap_content" android:layout_height="wrap_content"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="70dp"
android:layout_width="wrap_content"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:id="@+id/end_date_wheel">
<widget.WheelView android:id="@+id/end_day"
android:layout_height="wrap_content"
android:layout_width="46dp"/>
<widget.WheelView android:id="@+id/end_month"
android:layout_height="wrap_content"
android:layout_width="100dp"/>
<widget.WheelView android:id="@+id/end_year"
android:layout_height="wrap_content"
android:layout_width="wrap_content"/>
</LinearLayout>
</LinearLayout>
What is the expected output? What do you see instead?
I expect two wheels one under the "start date" label, and one under the "end
date" label, but instead, I got only 1 wheel under the "start date" label.
What version of the product are you using? On what operating system?
The latest version, and my OS is Windows 7.
Please provide any additional information below.
Original issue reported on code.google.com by mike.c...@silverqconsulting.com
on 16 Jan 2012 at 1:13
GoogleCodeExporter commented
I found the solution to it, if you declare the WheelView in XML, the Android
wheel will not show by default. You need to add ChangeListener and ViewAdaptors
for each of the month, year and day. After adding it, then the Android Wheel
shows.
Original comment by mike.c...@silverqconsulting.com
on 16 Jan 2012 at 5:14