Different width of layout inside RecyclerView and normal LinearLayout
问题 I have a card view class which looks like: public class CardTest extends LinearLayout { public CardTest(Context context) { super(context); LayoutInflater.from(getContext()).inflate(R.layout.card_main, this); } } the card_main.xml is like: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_height="wrap_content" android:layout_width="fill_parent" android