나는 작은 질문이있다. 내 테이블 행에서는 FacebookProfilePictureView를 추가하고 싶습니다. 간단한 ImageView를 추가하는 것과는 달리 몇 가지 오류가 발생합니다. 내가받는 출력을 보여주는 그림을 첨부하고 있습니다.동적으로 페이스 북 프로필 추가 테이블 행의 그림보기 android
일련 번호의 오른쪽에있는 흰색 상자는 profilepicview이 모든 시간을 설정 곳입니다. 또한, xml에서 크기를 50,50 (너비, 높이)로 설정했지만 Java에서는 지저분 해집니다. 내 코드는 아래와 같습니다.
XML 코드 :
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/view_below_linear_layout_three_team_spuck"
android:id="@+id/the_maintable_team_spuck"
>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/the_maintable_row_team_spuck">
<com.facebook.login.widget.ProfilePictureView
android:id="@+id/profile_pic_view_team_spuck"
android:layout_width="50dp"
android:layout_height="50dp"
android:visibility="gone"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</TableRow>
</TableLayout>
자바 코드 :
the_normal_image_view = new ImageView(view.getContext()); // this is the normal image view, no issues when adding this in table
profilePictureView = new ProfilePictureView(view.getContext()); // this is the profile pic view
the_maintable_row_team_spuck.removeAllViews();
the_maintable_row_team_spuck.setLayoutParams(new TableRow.LayoutParams
(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
the_maintable_row.setBackgroundResource(R.drawable.cell_shape);
/*the_smallperson_team_spuck.setImageResource(R.drawable.the_smallperson);
the_smallperson_team_spuck.setPadding(7, 7, 15, 0);*/
profilePictureView.setPadding(7, 7, 15, 0);
//the_maintable_row.addView(the_normal_image_view); // adding normal image view into row
the_maintable_row.addView(profilePictureView); // adding fb profile pic view in to row
the_maintable.addView(the_maintable_row_team_spuck, new TableRow.LayoutParams
(TableRow.LayoutParams.MATCH_PARENT, TableRow.LayoutParams.MATCH_PARENT));
어떤 도움을 주시면 감사하겠습니다, 감사합니다 :) 당신이 그런 이미지 뷰에 대한 사용자 프로필 이미지를 당신이해야로드하려면
친구에게 ID가 있다면 어떻게 될까요? –
친구의 이드를 어디에서 사용하나요? 프로필 사진을보기 만하면 되겠습니까? –
우리는 친구 IDS를 사용하여 그림을 얻을 수 있습니다 ... –