
Your problem is similar to one CommonWare's blog. Multiple-View ViewPager Options There are three approach. One of those is override getPageWidth()
in your PagerAdapter:
@Overridepublicfloat getPageWidth(int position){return(0.5f);}
The others is more complicated but there're attach source and long explanation so i don't copy here.
resource url : http://stackoverflow.com/questions/13194666/how-to-set-viewpager-size
techdrew 發表在 痞客邦 留言(0) 人氣()
techdrew 發表在 痞客邦 留言(0) 人氣()
Image image = null;
try
URL url = new URL("http://www.yahoo.com/image_to_read.jpg");
image = ImageIO.read(url);
} catch (IOException e) {
}
See javax.imageio package for more info. That’s using the AWT image. Otherwise you could do:
URL url = new URL("http://www.yahoo.com/image_to_read.jpg");
InputStream in = new BufferedInputStream(url.openStream());
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buf = new byte[1024];
int n = 0;
while (-1!=(n=in.read(buf)))
{
out.write(buf, 0, n);
}
out.close();
in.close();
byte[] response = out.toByteArray();
And you may then want to save the image so do:
FileOutputStream fos = new FileOutputStream("C://borrowed_image.jpg");
fos.write(response);
fos.close();
techdrew 發表在 痞客邦 留言(0) 人氣()
不知道有沒有人也跟我一樣覺得 windows 7 的系統音效很煩人
每次按下一個鍵就有聲音
常常開機會被超大聲的開機音效嚇到
其實要關閉系統音效很簡單,只需要幾個步驟
比較簡單的步驟只要開啟右下角的音量控制
打開混音器

把系統音響設置為靜音

基本上這樣就可以關閉大部分的系統音效
但是我設定成這樣後,每次開機還是會聽到開機的系統音效
像我常常帶電去上課,開機的時候都會發出聲音,實在是非常得丟臉
另一個方法可以完全的把系統音效關閉
首先在桌面上點右鍵
選取"個人化"

進入後選取"音效"

把"播放系統音效"的選擇取消

這樣就可以完整的把windows7的系統音效關閉了!!
techdrew 發表在 痞客邦 留言(2) 人氣()