Placing of fragments in HorizontalScrollView.

I have OxyPlot graph in fragment and the fragments are added to Dashboard page at design time. When Dashboard page gets render it displays 3 fragments but the third fragment shrinks in width. Is there any way to avoid the shrinking of the third fragment in such a way that half part of the third fragment is displayed without shrinking and half part of the fragment is displayed after scrolling?

Answers

  • TimoKeller.9444TimoKeller.9444 DEMember ✭✭

    Can you post your layout file? Without it, i can only tell you, that you should look for layout_width with a fix size. If you use a Layout inside your HorizontalScrollView and it set to "fill_parent", i think it will be shrinked to the size of the screen.

  • kailashKutekailashKute USMember

    Below is the code for dashboard details page

    <?xml version="1.0" encoding="utf-8"?>





















    The oxyplot chart data in EquitySectorAllocationFragment will always change and will be dynamic. The width of chart may increase or decrease depending on the data and when user scrolls the data will be displayed without shrinking.

    Below is the code for EquitySectorAllocationFragment.

    <?xml version="1.0" encoding="utf-8"?>


    <oxyplot.xamarinandroid.PlotView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/PlotAreaEquitySectorAllocation" />

  • kailashKutekailashKute USMember

    I have attached the files for Dashboard details page and the graph.

    The oxyplot chart data in EquitySectorAllocationFragment will always change and will be dynamic. The width of chart may increase or decrease depending on the data and when user scrolls the data will be displayed without shrinking.

  • CheesebaronCheesebaron DKInsider, University mod

    Take the code, paste it here, mark it and press the C button.

  • kailashKutekailashKute USMember

    Dashboard Details
    <?xml version="1.0" encoding="utf-8"?>





















    ``

    EquitySector Allocation

    <?xml version="1.0" encoding="utf-8"?>


    <oxyplot.xamarinandroid.PlotView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/PlotAreaEquitySectorAllocation" />
    ``

  • kailashKutekailashKute USMember

    EquitySectorAllocationFragment

    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/AssetAllocationPerformanceFragment" android:clickable="true" android:focusable="false" android:background="#ffff"> <TextView android:text="Equity sector allocation" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="20dp" android:textColor="#0892d1" android:paddingBottom="15dp" android:layout_gravity="top" android:layout_margin="2dp" android:paddingLeft="5dp" /> <oxyplot.xamarinandroid.PlotView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/PlotAreaEquitySectorAllocation" /> </LinearLayout>

  • kailashKutekailashKute USMember

    DashBoardDetails.
    <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#fffffe"> <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="right" android:minWidth="25px" android:minHeight="25px" android:layout_marginRight="15px" android:layout_gravity="right"> <fragment class="Moneyware.Mobile.Droid.Header" android:id="@+id/Header" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="0.0dp" android:layout_marginTop="0.0dp" /> </LinearLayout> <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:fillViewport="true" android:minWidth="25px" android:minHeight="25px"> <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <fragment class="Moneyware.Mobile.Droid.AlertFragment" android:id="@+id/Alerts" android:layout_width="400dp" android:layout_height="540dp" android:layout_marginBottom="18dp" android:layout_marginRight="4dp" /> <fragment class="Moneyware.Mobile.Droid.AppointmentFragment" android:id="@+id/Appointments" android:layout_width="400dp" android:layout_height="540dp" android:layout_marginLeft="0.0dp" android:layout_marginTop="0.0dp" /> <LinearLayout android:orientation="horizontal" android:background="#f7f7f7" android:id="@+id/ContainerAssetAllocationPerformance" android:layout_width="400dp" android:layout_height="fill_parent"> <fragment class="Moneyware.Mobile.Droid.AssetAllocationPerformanceFragment" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <fragment class="Moneyware.Mobile.Droid.AssetAllocationPerformanceLegendFragment" android:id="@+id/AssetAllocationPerformanceLegend" android:layout_width="200dp" android:layout_height="150dp" android:layout_marginLeft="8dp" android:layout_marginTop="16dp" android:layout_marginRight="24dp" android:layout_weight="0.6" /> </LinearLayout> <LinearLayout android:orientation="horizontal" android:layout_width="400dp" android:id="@+id/EquitySectorContainer" android:layout_height="fill_parent" android:background="#f7f7f7"> <fragment class="Moneyware.Mobile.Droid.EquitySectorAllocationFragment" android:id="@+id/EquitySectorAllocation" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> <fragment class="Moneyware.Mobile.Droid.ClientProfileFragment" android:id="@+id/ClientProfile" android:layout_width="400dp" android:layout_height="540dp" /> </LinearLayout> </HorizontalScrollView> <LinearLayout android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content"> <fragment class="Moneyware.Mobile.Droid.Footer" android:id="@+id/FooterFragment" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout>

Sign In or Register to comment.