① 大佬們,安卓新手求救啊,在android Studio中用RecyclerView瀑布流實現這個效果
網頁鏈接 參考這個,down下來自己改改就行了
② 求教 android瀑布流該如何實現
網上關於android瀑布流的例子一大堆,但是很多都是很復雜,對於新手來說有一定的難度。
原理很簡單,就是非同步下載圖片,把圖片addView到ScrollView(因為可以上下一直拖動)中,你需要屏幕顯示幾列就在ScrollView中放置幾個LinearLayout,
下面我就一個簡單的例子來講解android瀑布流的用法,樣子很醜就不上圖了。。
1、在xml布局文件:很簡單就是
2、在java代碼中:
先聲明幾個變數,其中imagePathStr數組用來存圖片的鏈接
private LinearLayout leftLayout;
private LinearLayout rightLayout;
private String[] imagePathStr = { "http://www.cf69.com/Upfiles/BeyondPic/2010-08/20108175740983313.jpg",
"http://www.syfff.com/UploadFile/pic/2008122163204.jpg", "http://pic.newssc.org/0/10/34/32/10343297_564251.jpg",
"http://ent.hangzhou.com.cn/images/20090311/zym2009031323.jpg", "http://a4.att.hudong.com/86/60/01300000013093119087608457965.jpg",
"http://file.sdteacher.gov.cn/upload/gz0901/images/0907/22/110437191.jpg",
"http://www.fun9.cn/uploadfile/starpic/uploadpics/200910/20091008090155126.jpg",
"http://img3.yxlady.com/yl/UploadFiles_5361/20110820/20110820120609469.jpg",
其次,在oncreate()中採用非同步載入圖片的方法把獲取到的Drawable添加到左右兩欄的LinearLayout中:
③ android 怎麼實現 逆向瀑布流
將實例化imageview往layout裡面添加
通過linearlayout
三個流的瀑布代碼:
④ 關於android類似美麗說中的瀑布流布局
<ScrollView>
<LinearLayout
androidi:orientation="horizontal">
<LinearLayout
android:id="@+id/list1"
androidi:orientation="vertical"
android:layout_width="0"
android:layout_weight="1">
<LinearLayout
android:id="@+id/list2"
androidi:orientation="vertical"
android:layout_width="0"
android:layout_weight="1">
<LinearLayout
android:id="@+id/list3"
androidi:orientation="vertical"
android:layout_width="0"
android:layout_weight="1">
</LinearLayout>
</LinearLayout>
</ScrollView>
然後可以不斷向三個list1,2,3添加ImageView,不就可以么?怎麼可能溢出?
⑤ android listview 每行中 有兩列。 第二列有兩行的效果是怎麼做的 下圖給圖~
可以用「瀑布流」實現。
github上有很多:https://github.com/search?utf8=%E2%9C%93&q=android+waterfall&type=Repositories&ref=searchresults
⑥ 瀑布流效果怎麼實現
登錄網站的後台。首先訪問http://域名/admin.php用管理員賬號直接登錄自己discuz網站的後台。
登錄後台後,在網站的後台找到 「界面」 按鈕,下的界面設置,點擊主題列表頁按鈕,出現設置界面,首先一般將「左側版塊導航寬度」設置為0。
往下拉,在主題封面寬度的設置里一般設置為 208,也可以自己修改成其他的,主題封面高度設置一般為 9999。
在網站後台 找到[論壇]欄目下面的[版塊管理]按鈕,選擇編輯自己想要開啟瀑布流的那個版塊,在該模塊的 [擴展設置] 里 開啟圖片列表模式。
很多時候,設置的瀑布流的模塊已經有帖子了,此時可以重建主題封面實現: 在後台的[工具]設置欄目下找到[更新統計]按鈕,點擊[重建主題封面]就可以了。
更新緩存,到相應的模塊查看瀑布流效果。
⑦ 如何給recyclerView瀑布流設置均等間距
adapter面計算寬高寬高讓伺服器獲取讓我自獲取
面說實現式吧
既要態適配寬高要根據圖片寬度手機寬度計算比率根據比率計算imageview高度
package com.jtech.scrollimageloaddemo;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import com.jtech.adapter.RecyclerAdapter;
import com.jtech.view.RecyclerHolder;
import java.util.ArrayList;
import java.util.List;
/**
* 圖片適配器
* 關於 同等間距recycleView
* 我xml文件設置距離dp 代碼設置距離px
* 所都代碼設置統格式同等編劇recyclerview
* Created by wuxuyang on 16/5/6.
*/
public class ImageAdapter extends RecyclerAdapter {
private boolean isScroll = false;
private int itemWidth;
public ImageAdapter(Activity activity) {
super(activity);
//計算item寬度
itemWidth = (DeviceUtils.getScreenWidth(activity)-48) / 2;
}
public void setScroll(boolean scroll) {
isScroll = scroll;
if (!isScroll) {
notifyDataSetChanged();
}
}
@Override
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup, int i) {
return layoutInflater.inflate(R.layout.view_item, viewGroup, false);
}
@Override
public void convert(RecyclerHolder recyclerHolder, ImageModel imageModel, int i) {
ImageView imageView = recyclerHolder.getView(R.id.imageview);
//等比縮放
double ratio = (itemWidth * 1.0) / imageModel.getWidth();
int height = (int) (imageModel.getHeight() * ratio);
ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
layoutParams.width = itemWidth;
layoutParams.height = height;
imageView.setLayoutParams(layoutParams);
//顯示圖片
// if (isScroll) {
// imageView.setImageResource(R.mipmap.ic_launcher);
// } else {
Glide.with(getActivity()).load(imageModel.getUrl()).placeholder(R.mipmap.ic_launcher).into(imageView);
// }
}
}
⑧ Android實現自動滾動的瀑布流怎麼實現
1、酷派手機左邊第一個桌面就是瀑布流(新聞桌面),這個其實用處不大,而且更新還費流量。點手機左鍵,打開桌面管理。
2、此時,會發現除了瀑布流之處。其餘的桌面都可以刪除。