我在选项卡之间加载了不同的图像。每个选项卡都有片段解决方案的实例。 但是图片只显示在第一个选项卡上,我不知道为什么。使用毕加索图书馆,我有同样的问题。
maven_install(
artifacts = IO_GRPC_GRPC_JAVA_ARTIFACTS,
generate_compat_repositories = True,
override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
repositories = [
"https://repo.maven.apache.org/maven2/",
],
)
片段的页面适配器
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
pic = getArguments().getString("pic");
}
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
img = view.findViewById(R.id.pic);
Glide.with(view.getContext())
.load(pic)
.into(img);
}
public static Solution newInstance(int sectionNumber, String[] array, String zadani, String [] pic){
Solution fragment = new Solution();
Bundle bundle1 = new Bundle();
String section;
section = array[sectionNumber];
String p;
p = pic [sectionNumber];
bundle1.putString("key", section);
bundle1.putString("pic", p);
bundle1.putString("zadani", zadani);
fragment.setArguments(bundle1);
return fragment;
}
}`