인터넷에서이 코드를 발견했지만 리사이클 러에서이 코드로 특성을 변경하지 않습니다. 어떤 해결책?맞춤 리사이클 러러는 속성을 변경하지 않습니다
XML에서는 올바르게 작동하지만 프로그래밍 방식으로는 아무 것도하지 않습니다.
<com.ScrollRecyclerView
style="@style/scrollbar_shape_style"
android:id="@+id/drop_down_list"
android:layout_width="wrap_content"
android:layout_height="300dp"></com.ScrollRecyclerView>
public class ScrollRecyclerView extends RecyclerView {
public ScrollRecyclerView(Context context) {
super(context);
}
public ScrollRecyclerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs, R.attr.scrollbarStyle);
}
public ScrollRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, R.attr.scrollbarStyle);
}
}
이 표준 생성자와 간단한 Recyclerview의 서브 클래스로, 사용자 정의 스크롤로합니다. Recyclerview가하지 않는 것은 아무것도하지 않습니다. – Kuffs
하위 클래스를 XML을 통해 직접 사용하거나 자신 만의 AttributeSet을 만들고 생성자를 통해 자신을 인스턴스화하는 방법은 무엇입니까? –
XML을 통해 ID – stankocucuz2