×

promise的用法 is

promise用法搭配?android expandablelistview可以实现哪些效果

admin admin 发表于2022-06-01 19:26:06 浏览142 评论0

抢沙发发表评论

promise用法搭配


作为动词意思是允诺,许诺;给人以…的指望或希望 [I,T];名词意思是许诺,允诺。

用法:

promise sth to sb 答应某事对某人

promise sb sth 答应某人某事

promise to do sth 答应做某事

make a promise 许诺

keep a promise 遵守诺言

Monther ,do you really promise her?

妈妈,你真的承诺她?

They promise they will never raid tourist.

他们保证再也不抢劫游客。

扩展资料

promise相关的词义辨析:

ensure、insure、assure、guarantee、pledge、promise这些动词都有“保证”之意。 

1、ensure侧重使人相信某个行为或力量产生的结果。 

2、insure常与ensure换用,但前者多指经济方面的保证、保险。 

3、assure侧重指消除某人思想上的怀疑或担心,从而有达到目的的保证感,但不如ensure普通。

4、guarantee指对事物的品质或人的行为及履行义务、义务等承担责任的保证。 

5、pledge正式用词,指通过郑重许诺、协议或立誓等保证承担某一义务或遵守某一原则。

6、promise侧重表自己的主观意向,设法用语言使人感到稳当可靠。


android expandablelistview可以实现哪些效果


Android中ExpandableListView的使用
ExpandableListView是android中可以实现下拉list的一个控件,具体的实现方法如下:
首先:在layout的xml文件中定义一个ExpandableListView
view plain copy to clipboard print ?
《 LinearLayout
android:id =“@+id/linearLayout“
android:layout_width =“fill_parent“
android:layout_height =“fill_parent“
androidrientation =“vertical“


《 ExpandableListView
android:id =“@+id/expandableListView“
android:layout_width =“fill_parent“
android:layout_height =“wrap_content“
/》
《/ LinearLayout 》

定义两个List,用来存放控件中Group/Child中的String
view plain copy to clipboard print ?
private List《String》 groupArray;
private List《List《String》》 childArray;

对这两个List进行初始化,并插入一些数据

view plain copy to clipboard print ?
groupArray = new ArrayList《String》();
childArray = new ArrayList《List《String》》();

groupArray.add(“第一行“ );
groupArray.add(“第二行“ );

List《String》 tempArray = new ArrayList《String》();
tempArray.add(“第一条“ );
tempArray.add(“第二条“ );
tempArray.add(“第三条“ );

for (int index = 0 ; index 《groupArray.size(); ++index)
{
childArray.add(tempArray);
}

定义ExpandableListView的Adapter

view plain copy to clipboard print ?
//ExpandableListView的Adapter
public class ExpandableAdapter extends BaseExpandableListAdapter
{
Activity activity;

public ExpandableAdapter(Activity a)
{
activity = a;
}
public Object getChild(int groupPosition, int childPosition)
{
return childArray.get(groupPosition).get(childPosition);
}
public long getChildId(int groupPosition, int childPosition)
{
return childPosition;
}
public int getChildrenCount(int groupPosition)
{
return childArray.get(groupPosition).size();
}
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent)
{
String string = childArray.get(groupPosition).get(childPosition);
return getGenericView(string);
}
// group method stub
public Object getGroup(int groupPosition)
{
return groupArray.get(groupPosition);
}
public int getGroupCount()
{
return groupArray.size();
}
public long getGroupId(int groupPosition)
{
return groupPosition;
}
public View getGroupView(int groupPosition, boolean isExpanded,
View convertView, ViewGroup parent)
{
String string = groupArray.get(groupPosition);
return getGenericView(string);
}
// View stub to create Group/Children ’s View
public TextView getGenericView(String string)
{
// Layout parameters for the ExpandableListView
AbsListView.LayoutParams layoutParams = new AbsListView.LayoutParams(
ViewGroup.LayoutParams.FILL_PARENT, 64 );
TextView text = new TextView(activity);
text.setLayoutParams(layoutParams);
// Center the text vertically
text.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT);
// Set the text starting position
text.setPadding(36 , 0 , 0 , 0 );
text.setText(string);
return text;
}
public boolean hasStableIds()
{
return false ;
}
public boolean isChildSelectable(int groupPosition, int childPosition)
{
return true ;
}
}

最后,给定义好的ExpandableListView添加上Adapter

view plain copy to clipboard print ?
ExpandableListView expandableListView = (ExpandableListView)findViewById(R.id.expandableListView);
expandableListView.setAdapter(new ExpandableAdapter(Main.this ));

运行即可见效果~~~
-promise的用法

“主人公“用英语怎么说


dramatis personae n. 主人公

英[ˈdræmətis pə:ˈsəunai]

美[ˈdræmətɪs pɚˈsoni] |[ˈdrɑmətɪs pɚˈsoˌnaɪ]