position

模仿QQListView左滑删除置顶Item

余生颓废 提交于 2019-12-10 14:12:45
 解决方法很简单,就是在更新Listview的时候,不要使用setAdapter,如果这样位置就会置顶了;需要更新ListView的时候,使用Adapter对象的notifyDataSetChanged方法吧。   使用notifyDataSetChanged方法的时候注意了,更新列表是所有列表项都会被更新,这里存在一个性能上 的问题,所以如果你需要改变的只是单一个列表项,建议不要使用notifyDataSetChanged方法,转而使用获得该列表项后,然后对里面的控件 进行调整吧。   有些时候调用notifyDataSetChanged方法后,getView并没有自行调用,这时候的解决办法是调用listview的requestLayout方法即可。 /** * 置顶 * * @param position */ private void setTop(int position) { list.get(position).setSetTop("取消置顶"); list.add(0, list.get(position)); // 置顶后list.size增加一 所以要position+1 list.remove(position + 1); adapter.notifyDataSetChanged(); } /** * 取消置顶 * * @param position */

ListView实现单选CHOICE_MODE_SINGLE

偶尔善良 提交于 2019-12-10 14:05:21
以前设置Listview为单选都是在数据中设置一个checked字段, 或者找一个position的全局变量来实现, 如果只是为了UI展示就要添加一个字段就比较麻烦了, 其实谷歌提供了一个api接口来实现 单选多选功能: Step 1 mShopdetail_category .setChoiceMode(AbsListView. CHOICE_MODE_SINGLE ) ; //设置选中模式为单选 Step 2 在Adapter中: @Override public void onGetView(View convertView, final int position) { MenuGroup menuGroup = mDataList.get(position); TextView shopdetail_item_name = findViewById(convertView, R.id.shopdetail_item_name); shopdetail_item_name.setText(menuGroup.getGroup_name()); shopdetail_item_name.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { mShopdetail

HTML实现3D相册

最后都变了- 提交于 2019-12-10 13:18:56
< style > . big_box { position : relative ; border : 1 px solid red ; width : 600 px ; height : 600 px ; margin : 150 px auto ; } . box { position : absolute ; top : 25 % ; left : 25 % ; width : 50 % ; height : 50 % ; border : 1 px solid black ; transform - style : preserve - 3 d ; /*perspective: 500px;*/ animation : r1 8 s linear infinite ; /* margin:0 auto; */ cursor : cell ; /* cursor 是鼠标经过时的样式 */ } . box : hover { transform : rotate ( 360 deg ) rotateX ( 360 deg ) rotate ( 360 deg ) ; } . box > div { position : absolute ; top : 0 ; left : 0 ; width : 100 % ; height : 100 % ; opacity : 0.6

SWFObject and positioning

坚强是说给别人听的谎言 提交于 2019-12-10 13:18:37
问题 How can I specifically position the flash element embeded using SWFObject please? Moving it's container DIV around with absolute positioning and top and bottom set doesn't seem to work. Thank you. 回答1: @Francisc: Try -- <div id="container-div-with-the-positioning-rules"> <div id="flash-to-be-replaced"> Your alternate content if the user doesn't have Flash installed </div> </div> Please note , this might not be the most elegant solution since it's adding an additional <div> , but having had

How to avoid position: fixed from staying on the screen when vertical scrolling?

自作多情 提交于 2019-12-10 12:31:02
问题 I asked this question which worked great for making text (top links) forced to the right after scrolling. The issue is one on the page, when I scroll vertically, the top links stay on the top of the page even when I scroll down so they show above my main content. What is a way to force text to be forced to the right but don't move when I scroll vertically? Here is my CSS today: #toplinks ul { -moz-background-clip:border; -moz-background-inline-policy:continuous; -moz-background-origin:padding

How to get the correct offset top value from webkit (Chrome/Safari) with jQuery? Webkit bug?

风格不统一 提交于 2019-12-10 11:47:34
问题 I'm working on code that programmatically positions a div to give the appearance of scrolling. All works fine when using Firefox and Internet Explorer (believe it or not). However, I'm getting bogus values from webkit browsers (Chrome/Safari). It appears to have something to do with whether an element has content. I'm calculating the position of an empty anchor element. Webkit seems to get it right only when the element has visible content. So, I could work around this by having some content

JQuery UI Dialog Positioning Center of Parent

我们两清 提交于 2019-12-10 11:40:48
问题 I have a functioning snippet as follows... function LoadTheDialog($url) { $dialog = $('<div></div>'); $dialog.html('<iframe id="theDialog" src="' + $url + '" width="530px" height="600px" style="border: 0px;"></iframe>'); $dialog.dialog({ width: 555, modal: true, resizable: false, draggable: false, open: function (type, data) { $($dialog).parent().appendTo("body"); } }).dialog('widget').position({ my: "center", at: "center", of: window, collision: "none" }); }; no matter what I have tried thus

How to make the jQuery Sticky Float plug-in react live to page changes?

余生长醉 提交于 2019-12-10 11:00:04
问题 I've been looking at the really rather wonderful 'stickyfloat' plug-in (http://plugins.jquery.com/files/stickyfloat_0.htm) for jQuery for a project I'm working on. I need to keep a panel on the right of the page 'in view' as the content on the left scrolls. The stickyfloat plug-in works a treat but it doesn't update it calculations if you use jQuery to effect the length of the content block in which it sits. Is there any way I might be able to adjust this plug-in to make it respect live

jQuery move divs according to mouse position

ぐ巨炮叔叔 提交于 2019-12-10 10:23:55
问题 I got a little Problem with jQuery, maybe you guys can help me. Here's the HTML Markup in jfiddle for better understanding: jsfiddle I'd like to have the div called #move_me to move either to the right or to the left side within the #content_wrapper according to the mouse position inside #content_wrapper . Basically what I want is: if I move my cursor inside the #content_wrapper div to the right then the #move_me div should move to the left to see content2 div, when I move to the left the

Manipulate positioning of jQuery Mobile Footer

对着背影说爱祢 提交于 2019-12-10 10:22:59
问题 I have a question that has been viewed, but with no answers or comments on the matter, so I thought I'd try to simplify my question. For those curious about my overall issue, please see the link: Persistent header in jQuery Mobile Anyways, my question is how can I force the JQM footer to be at the top instead of the bottom? Here's the code for the JQM footer. It persists fine across page transitions, but it is at the foot of the page and I need it at the head: <div data-role="footer" data