보다이 스크린 샷은 산들 바람Cardview이 장치에서 제대로 작동하지 않는 낮은 롤리팝
이 하나가 이미지가 표시되지 않습니다에 젤리 콩에서 가져온 것입니다 촬영하고 메뉴의 텍스트입니다 하지
볼 나는 부모보기로 Cardview와 레이아웃을 가지고있다.
이미지와 텍스트로 구성됩니다.
: 이제 레이아웃은 이미지 properly.They 작은 켜고 완전히 여기의 내 레이아웃 XML 파일을 카드보기를 일치하지 않습니다 표시되지 않습니다 안드로이드 M과 이상 장치에 있지만 (젤리 빈 등) 낮은 버전에서 잘 작동
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
app:cardPreventCornerOverlap="false"
android:elevation="2dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<android.support.v7.widget.CardView
android:layout_width="80dp"
android:layout_height="80dp">
<ImageView
android:id="@+id/home_news_image"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_gravity="center_vertical"
android:scaleType="centerCrop"
android:src="@drawable/jesus" />
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/home_title_parish_news"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingLeft="1dp"
android:text="Christmas Celebration"
android:textSize="14dp"
android:textStyle="bold" />
<TextView
android:id="@+id/home_short_description"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:padding="3dp"
android:text="hi this is to tell thlkdsa asdsag slk sg sdg sdgjs gsd gsg jglsgja gasjggjasg asgjasgj sgjasg g g"
android:textSize="12dp" />
<TextView
android:id="@+id/home_date_published"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:gravity="right|bottom"
android:padding="3dp"
android:text="10/10/2010"
android:textSize="8dp" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
이 내가 텍스트가 표시되지 않는 이미지에서 텍스트를 배치하면 난 내 레이아웃 및 뷰 또한
public class MenuAdapter extends BaseAdapter {
Context mContext;
ArrayList<MenuModel> list;
String img;
public MenuAdapter(Context c, ArrayList<MenuModel> list) {
mContext = c;
this.list = list;
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int i) {
return i;
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
View grid;
LayoutInflater inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (view == null) {
grid = inflater.inflate(R.layout.home_grid_menu, null);
TextView textView = (TextView) grid.findViewById(R.id.home_grid_text);
ImageView imageView = (ImageView) grid.findViewById(R.id.home_grid_image);
textView.setText(list.get(i).getMenuName());
imageView.setImageResource(list.get(i).getMenuImage());
} else {
grid = (View) view;
}
return grid;
}
}
를 초기화 어댑터입니다.
제발 어떻게 가야할지 제안 해주세요.
나는 그들이 뒤로 지원을하지만, 렌더링은 일반적으로 동일하지 않습니다, 내가
이 두 이미지를 첨부 안드로이드 의도를 사용하여 텍스트를 공유 할 수 있습니다. –
framelayout에서 cardview를 래핑 해보세요 (선형보기와 카드보기 사이에 추가). – Jimmy
레이아웃을 초기화하는 코드는 어디에 있습니까? – DeKaNszn