<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dip"
android:background="@drawable/greybox"
>
<ImageView
android:id="@+id/profile_pic"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginTop="5dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@+id/profile_pic">
<TextView
android:id="@+id/name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Kumar"
android:textSize="18dp"
android:textColor="#4c3f38"
android:layout_alignParentLeft="true"
/>
<TextView
android:id="@+id/msg"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="15dp"
android:layout_below="@+id/name"
android:textColor="#7b7674"
/>
<LinearLayout
android:id="@+id/picpostlayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|center"
android:layout_marginTop="5dp"
android:layout_below="@+id/msg"
android:orientation="vertical" >
<ImageView
android:id="@+id/picpost"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:src="@null" />
</LinearLayout>
<TextView
android:id="@+id/comment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="15dp"
android:layout_marginTop="5dp"
android:layout_marginRight="5dp"
android:layout_below="@+id/picpostlayout"
android:layout_alignParentRight="true"
android:textColor="#000000"
/>
</RelativeLayout>
</RelativeLayout>
Here is my complete xml.I am using the linearlayout to show the posted picture,but it is still showing very small size.I used two relative layouts, one for complete xml and another for name,message,postpicture.
Here is also my screenshot to the above given xml file.I am getting the large image but I cant able to show the same size,it is showing very small size.
I got an post picture from facebook api,I am getting very large image as I used _n.jpg,but when I tried to display using imageview it is showing very small size.
][1]
[1]: http://i.stack.imgur.com/63nTO.png
Here is the code of getting posted picture from facebook api.If the post object has picture field then I get that picture and changed that into large image and I added that to my ArrayList pic.
if(jsonObject.has("picture"))
{
String fetchedURL = jsonObject.getString("picture");
String getFeedPicture = fetchedURL.replaceAll("_s.jpg", "_n.jpg");
pic.add(getFeedPicture);
}
然後我發送該ArrayList到我的適配器,我通過發送到imageloader類將該圖像設置爲imageview。 這是我的裝載機類參考圖像加載程序,我將圖像設置爲imageview.I設置它在我的適配器類。如何增加facebook api發佈圖片的大小?
imageLoader.DisplayImage(postimage.get(position).replace(「」,「%20」),postimg);
你可以張貼一些代碼來展示你是如何獲取的圖像? –
webserv =「https://graph.facebook.com/me/home?access_token=」+ accesstoken; pic.add(jsonObject.getString( 「圖片」)); – veerendra
你還可以發佈它的外觀截圖嗎? –