5 Haziran 2017 Pazartesi

İçinden Scrol+ itemler veya Scrol + Scroll Bulunan Layoutlar için Yapılandırma

public class MyGridView  extends GridView {

    public MyGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyGridView(Context context) {
        super(context);
    }

    public MyGridView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
---------------------------------------------------------------------------
public class NonScrollExpandableListView extends ExpandableListView {

    public NonScrollExpandableListView(Context context) {
        super(context);
    }

    public NonScrollExpandableListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NonScrollExpandableListView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    @Override    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int heightMeasureSpec_custom = MeasureSpec.makeMeasureSpec(
                Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, heightMeasureSpec_custom);
        ViewGroup.LayoutParams params = getLayoutParams();
        params.height = getMeasuredHeight();
    }
}
----------------------------------------------------------------------
      
<android.support.v4.widget.NestedScrollView    android:layout_below="@+id/Arama"    android:layout_width="match_parent"    android:layout_height="match_parent">
    <RelativeLayout        android:layout_width="match_parent"        android:layout_height="match_parent">


    <com.example.argede_8.birseylazimmi.customGrid.MyGridView
        android:id="@+id/listeolustur_Gridview"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:columnWidth="90dp"        android:numColumns="auto_fit"        android:stretchMode="columnWidth"        android:gravity="center"        android:layout_marginLeft="15dp"        android:layout_marginRight="15dp"        />

    <com.example.argede_8.birseylazimmi.customGrid.NonScrollExpandableListView        android:groupIndicator="@null"        android:layout_marginTop="5dp"        android:layout_below="@+id/listeolustur_Gridview"        android:id="@+id/expand_listview"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:layout_marginLeft="15dp"        android:layout_marginRight="15dp"        android:layout_marginBottom="10dp"        >
    </com.example.argede_8.birseylazimmi.customGrid.NonScrollExpandableListView>
    </RelativeLayout>
</android.support.v4.widget.NestedScrollView>


















































1 yorum:

  1. Not : NonScrol Activity üzerinde Çökebiliyor ,, Fragment Üzerinden kullanımı Daha uygun .

    YanıtlaSil