- 博客(9)
- 收藏
- 关注
原创 ListView
以上下滑动的形式显示多项同类型内容效果如下(图片资源来自网络)可以通过滑动的方式浏览图片代码如下<ListView android:id="@+id/list_view" android:layout_width="match_parent" android:layout_height="match_parent" />在主活动创建一个
2017-04-26 22:11:13
200
原创 引入布局
为减少代码量,可以引用已经写好的布局和相应的活动这里创建一个title布局被引用<!--title.xml--><?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_
2017-04-25 22:16:04
401
原创 Android基本布局-FrameLayout
帧布局将所有控件放在布局左上角<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_pa
2017-04-23 21:12:18
197
原创 Android基本布局-RelativeLayout
相对布局可以让空间以相对位置的形式出现在布局的任意位置控件与父布局对齐<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:
2017-04-22 21:35:26
153
原创 for循环 逗号表达式
C++for(vector::iterator iter = m_FYourfriend.begin(),int i = 1 ; iter != m_FYourfriend.end(); i++) { file << "Friend " << i << " : " << endl; file m_DFriendid << endl; file m_SFriendname << e
2016-08-02 18:04:26
846
原创 for循环中break与i++执行
#include using namespace std;int main(){ int i = 0; for (int j = 0 ; i < 5 ; i++ , j++) { if(i < 3) { cout << i << endl; } else break; } cout << i << endl; //i++没有执行 }break
2016-07-30 21:15:01
4948
原创 break&continue
#include #include using std::cout;using std::endl;int main(){ for (int i = 0; i < 9; i++) { cout << i << endl; if (i == 4) break; else continue; } system("pause"); return 0;}
2016-07-29 15:49:13
208
原创 欢迎使用CSDN-markdown编辑器
//Friend为自定义类,m_FYourfriends为类中的private成员 for (vector::iterator iter = m_FYourfriends.begin(); iter != m_FYourfriends.end(); iter++) { if (iter->m_DFriendid == id) { m_FYourfriends
2016-07-27 17:55:12
184
原创 if else 配对
if(…) { if(…) { /// } } else { /// } else与最近的if配对if(…) { if(…) { /// } else { /// } } else { /// }
2016-07-27 17:09:42
902
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人