首页 文章 精选 留言 我的

精选列表

搜索[命令行界面],共10007篇文章
优秀的个人博客,低调大师

droid用户界面-布局管理Layout

在 Android 中各种布局的应用,以及菜单效果的实现 各种布局方式的应用,FrameLayout, LinearLayout, TableLayout, AbsoluteLayout, RelativeLayout 为指定元素配置上下文菜单,为应用程序配置选项菜单,以及多级菜单的实现 各种布局方式的演示res/layout/main.xml <?xmlversion="1.0"encoding="utf-8"?> <!-- layout_width-宽。fill_parent:宽度跟着父元素走;wrap_content:宽度跟着本身的内容走;直接指定一个px值来设置宽 layout_height-高。fill_parent:高度跟着父元素走;wrap_content:高度跟着本身的内容走;直接指定一个px值来设置高 --> <!-- LinearLayout-线形布局。 orientation-容器内元素的排列方式。vertical:子元素们垂直排列;horizontal:子元素们水平排列 gravity-内容的排列形式。常用的有top,bottom,left,right,center等,详见文档 --> <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"android:gravity="right" android:layout_width="fill_parent"android:layout_height="fill_parent"> <!-- FrameLayout-层叠式布局。以左上角为起点,将FrameLayout内的元素一层覆盖一层地显示 --> <FrameLayoutandroid:layout_height="wrap_content" android:layout_width="fill_parent"> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="FrameLayout"> </TextView> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="FrameLayout"> </TextView> </FrameLayout> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="@string/hello"/> <!-- TableLayout-表格式布局。 TableRow-表格内的行,行内每一个元素算作一列 collapseColumns-设置TableLayout内的TableRow中需要隐藏的列的列索引,多个用“,”隔开 stretchColumns-设置TableLayout内的TableRow中需要拉伸(该列会拉伸到所有可用空间)的列的列索引,多个用“,”隔开 shrinkColumns-设置TableLayout内的TableRow中需要收缩(为了使其他列不会被挤到屏幕外,此列会自动收缩)的列的列索引,多个用“,”隔开 --> <TableLayoutandroid:id="@+id/TableLayout01" android:layout_width="fill_parent"android:layout_height="wrap_content" android:collapseColumns="1"> <TableRowandroid:id="@+id/TableRow01"android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextViewandroid:layout_width="wrap_content" android:layout_weight="1"android:layout_height="wrap_content" android:text="行1列1"/> <TextViewandroid:layout_width="wrap_content" android:layout_weight="1"android:layout_height="wrap_content" android:text="行1列2"/> <TextViewandroid:layout_width="wrap_content" android:layout_weight="1"android:layout_height="wrap_content" android:text="行1列3"/> </TableRow> <TableRowandroid:id="@+id/TableRow01"android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="行2列1"/> </TableRow> </TableLayout> <!-- AbsoluteLayout-绝对定位布局。 layout_x-x坐标。以左上角为顶点 layout_y-y坐标。以左上角为顶点 --> <AbsoluteLayoutandroid:layout_height="wrap_content" android:layout_width="fill_parent"> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="AbsoluteLayout" android:layout_x="100px" android:layout_y="100px"/> </AbsoluteLayout> <!-- RelativeLayout-相对定位布局。 layout_centerInParent-将当前元素放置到其容器内的水平方向和垂直方向的中央位置(类似的属性有:layout_centerHorizontal,layout_alignParentLeft等) layout_marginLeft-设置当前元素相对于其容器的左侧边缘的距离 layout_below-放置当前元素到指定的元素的下面 layout_alignRight-当前元素与指定的元素右对齐 --> <RelativeLayoutandroid:id="@+id/RelativeLayout01" android:layout_width="fill_parent"android:layout_height="fill_parent"> <TextViewandroid:layout_width="wrap_content"android:id="@+id/abc" android:layout_height="wrap_content"android:text="centerInParent=true" android:layout_centerInParent="true"/> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="marginLeft=20px" android:layout_marginLeft="20px"/> <TextViewandroid:layout_width="wrap_content" android:layout_height="wrap_content"android:text="xxx" android:layout_below="@id/abc"android:layout_alignRight="@id/abc"/> </RelativeLayout> </LinearLayout> res/values/strings.xml <?xmlversion="1.0"encoding="utf-8"?> <resources> <stringname="hello">HelloLayout</string> <stringname="app_name">webabcd_layout</string> </resources> Main.java packagecom.webabcd.layout; importandroid.app.Activity; importandroid.os.Bundle; publicclassMainextendsActivity{ /**Calledwhentheactivityisfirstcreated.*/ @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); } } 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080699

优秀的个人博客,低调大师

android用户界面-提示信息Toast

在程序中创建toast的步骤说明如下 1、调用toast的静态方法makeText()添加现实文本和时长。 2、调用toast的show()显示。 实例如下: /Chapter04_UI_Toast/src/com/amaker/test/MainActivity.java 代码 packagecom.amaker.test; importandroid.app.Activity; importandroid.os.Bundle; importandroid.view.View; importandroid.view.View.OnClickListener; importandroid.widget.Button; importandroid.widget.Toast; publicclassMainActivityextendsActivity{ /**Calledwhentheactivityisfirstcreated.*/ privateButtonb1,b2; @Override publicvoidonCreate(BundlesavedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.main); b1=(Button)findViewById(R.id.Button01); b2=(Button)findViewById(R.id.Button02); finalintl=Toast.LENGTH_LONG; finalints=Toast.LENGTH_SHORT; finalStrings1="我多显示一会儿!"; finalStrings2="我少显示一会儿!"; b1.setOnClickListener(newOnClickListener(){ publicvoidonClick(Viewv){ Toastt1=Toast.makeText(getApplicationContext(),s1,l); t1.show(); } }); b2.setOnClickListener(newOnClickListener(){ publicvoidonClick(Viewv){ Toastt2=Toast.makeText(getApplicationContext(),s2,s); t2.show(); } }); } } 本文转自linzheng 51CTO博客,原文链接:http://blog.51cto.com/linzheng/1080701

优秀的个人博客,低调大师

安卓注册登录界面示例

版权声明:本文可能为博主原创文章,若标明出处可随便转载。 https://blog.csdn.net/Jailman/article/details/78020173 AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="online.geekgalaxy.layoutlearn"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".login"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> <activity android:name=".register"> <intent-filter> <action android:name="android.intent.action.MAIN" /> </intent-filter> </activity> </application> </manifest> MainActivity.java package online.geekgalaxy.layoutlearn; import android.content.DialogInterface; import android.content.Intent; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); //login button final Button login = (Button) findViewById(R.id.button); final String user = "admin"; final String pass = "hello"; login.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { String username = ""; EditText editText1 = (EditText)findViewById(R.id.editText); username = editText1.getText().toString(); String password = ""; EditText editText2 = (EditText)findViewById(R.id.editText2); password = editText2.getText().toString(); if (username.equals(user) & password.equals(pass)) { Intent intent = new Intent(MainActivity.this, login.class); startActivity(intent); } else { new AlertDialog.Builder(MainActivity.this).setTitle("Error!").setMessage("Wrong username or password.") .setNegativeButton("OK",null) .show(); } } }); //register button final Button register = (Button) findViewById(R.id.button2); register.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { //提示框确定是否跳转 new AlertDialog.Builder(MainActivity.this).setTitle("Jump").setMessage("Ready to jump?") .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(MainActivity.this, register.class); startActivity(intent); }}) .setNegativeButton("No",null) .show(); } }); } } login.java package online.geekgalaxy.layoutlearn; import android.app.Activity; import android.os.Bundle; /** * Created by jailman on 2017/9/18. */ public class login extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.login); } } register.java package online.geekgalaxy.layoutlearn; import android.app.Activity; import android.os.Bundle; /** * Created by jailman on 2017/9/18. */ public class register extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.register); } } activity_main.xml <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerVertical="true" tools:context="online.geekgalaxy.layoutlearn.MainActivity"> <Button android:id="@+id/button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="68dp" android:text="@string/login" app:layout_constraintRight_toLeftOf="@+id/button2" tools:layout_constraintTop_creator="1" android:layout_marginEnd="68dp" android:layout_marginTop="26dp" app:layout_constraintTop_toBottomOf="@+id/editText2" /> <Button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/register" tools:layout_constraintTop_creator="1" tools:layout_constraintRight_creator="1" android:layout_marginEnd="68dp" app:layout_constraintRight_toRightOf="parent" android:layout_marginTop="26dp" app:layout_constraintTop_toBottomOf="@+id/editText2" /> <EditText android:id="@+id/editText" android:layout_width="240dp" android:layout_height="45dp" android:layout_marginBottom="35dp" android:layout_marginEnd="68dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginStart="68dp" android:ems="10" android:hint="@string/username" android:inputType="textPersonName" app:layout_constraintBottom_toTopOf="@+id/editText2" app:layout_constraintHorizontal_bias="0.516" app:layout_constraintLeft_toLeftOf="@+id/editText2" app:layout_constraintRight_toRightOf="@+id/editText2" tools:layout_constraintLeft_creator="1" tools:layout_constraintRight_creator="1" tools:layout_editor_absoluteX="-15dp" tools:layout_editor_absoluteY="152dp" /> <EditText android:id="@+id/editText2" android:layout_width="240dp" android:layout_height="45dp" android:layout_marginEnd="69dp" android:layout_marginLeft="0dp" android:layout_marginRight="0dp" android:layout_marginStart="69dp" android:ems="10" android:hint="@string/password" android:inputType="textPassword" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="@+id/button" app:layout_constraintRight_toRightOf="@+id/button2" app:layout_constraintTop_toTopOf="parent" tools:layout_constraintBottom_creator="1" tools:layout_constraintLeft_creator="1" tools:layout_constraintRight_creator="1" tools:layout_constraintTop_creator="1" /> <TextView android:id="@+id/textView2" android:layout_width="250dp" android:layout_height="65dp" android:layout_marginBottom="50dp" android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:autoText="false" android:text="Welcome" android:textAlignment="center" android:textSize="50sp" android:textStyle="bold" app:layout_constraintBottom_toTopOf="@+id/editText" app:layout_constraintHorizontal_bias="0.509" app:layout_constraintLeft_toLeftOf="@+id/editText" app:layout_constraintRight_toRightOf="@+id/editText" /> </android.support.constraint.ConstraintLayout> login.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:weightSum="1"> <TextView android:id="@+id/textView3" android:layout_width="0dp" android:layout_height="118dp" android:layout_marginTop="200dp" android:layout_weight="1" android:text="@string/great_you_ve_login" android:textAlignment="center" android:textSize="24sp" android:textStyle="bold" /> </LinearLayout> register.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical|center_horizontal" android:orientation="vertical"> <EditText android:id="@+id/editText5" android:layout_width="270dp" android:layout_height="wrap_content" android:ems="10" android:hint="Username" android:inputType="textPersonName" /> <EditText android:id="@+id/editText6" android:layout_width="270dp" android:layout_height="wrap_content" android:ems="10" android:hint="Email" android:inputType="textPersonName" /> <EditText android:id="@+id/editText7" android:layout_width="270dp" android:layout_height="wrap_content" android:ems="10" android:hint="Password" android:inputType="textPassword" /> <EditText android:id="@+id/editText8" android:layout_width="270dp" android:layout_height="wrap_content" android:ems="10" android:hint="Confirm password" android:inputType="textPassword" /> <Button android:id="@+id/button3" android:layout_width="270dp" android:layout_height="wrap_content" android:text="Submit" /> </LinearLayout> </LinearLayout> strings.xml <resources> <string name="app_name">LayoutLearn</string> <string name="login">Login</string> <string name="register">Register</string> <string name="username">Username</string> <string name="password">Password</string> <string name="great_you_ve_login">Great, you\'ve logged in!</string> </resources> build.gradle apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { applicationId "online.geekgalaxy.layoutlearn" minSdkVersion 19 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' compile 'com.android.support.constraint:constraint-layout:1.0.2' testCompile 'junit:junit:4.12' }

优秀的个人博客,低调大师

ios 界面间跳转方法总结

方式一:Storyboard的segues方式 鼠标点击按钮button然后按住control键拖拽到SVC页面,在弹出的segue页面中选择跳转模式即可 优点:操作方便,无代码生成,在storyboard中展示逻辑清晰 缺点:页面较多时不方便查看,团队合作时可维护性差, 多人合作时不建议使用这种方式。 方式二:选项卡UITabBarController控制器 通过调用UITabBarController的addChildViewController方法添加子控制器,代码实例如下: 1 2 3 4 5 6 7 8 9 10 UITabBarController *tabbarVC = [[ UITabBarController alloc ] init ]; FirstViewController *FVC = [[FirstViewController ] init ]; FVC.tabBarItem.title = @ "控制器1" ; FVC.tabBarItem.image = [ UIImage imageNamed : @ "first.png" ]; SecondViewController *SVC = [[SecondViewController ] init ]; SVC.tabBarItem.title = @ "控制器2" ; SVC. tabBarItem.image = [UIImage imageNamed : @ "new.png" ]; // 添加子控制器(这些子控制器会自动添加到UITabBarController的 viewControllers 数组中) [tabbarVC addChildViewController :FVC]; [tabbarVC addChildViewController :SVC]; 优点:代码量较少 缺点:tabbar的ios原生样式不太好看,(不常用,目前不建议使用),如果要使用,建议自定义tabbar 方式三:导航控制器UINavigationController 在FVC的button的监听方法中调用: 1 [self.navigationController pushViewController:newC animated:YES]; //跳转到下一页面 在SVC的方法中调用: 1 [self.navigationController popViewControllerAnimated:YES]; //返回上一页面 当有多次跳转发生并希望返回根控制器时,调用: 1 [ self .navigationController popToRootViewControllerAnimated: YES ]; //返回根控制器,即最开始的页面 方式四:利用 Modal 形式展示控制器 在FVC中调用: 1 [ self presentViewController:SVC animated: YES completion:nil]; 在SVC中调用: 1 [ self dismissViewControllerAnimated: YES completion: nil ]; 方式五:直接更改UIWindow 的 rootViewController 总结: Storyboard方式适合个人开发小程序时使用,有团队合作或者项目较大时不建议使用 UITabBarController因为目前系统的原生样式不太美观,不建议使用 推荐使用UINavigationController和Modal,无明显缺点,而且目前大部分程序都使用这两种方式,只是看是否需要导航控制器而确定使用哪种方案

优秀的个人博客,低调大师

IPython 7.26 发布,Python 命令行交互

IPython 7.26现已发布,这是一个次要版本,修复了一些问题、更新了 API,以及围绕代码库各部分的版权/许可证问题。IPython 提供了丰富的工具包,可帮助你以交互方式充分利用 Python。 官方强调了https://github.com/ipython/ipython/issues/13039这个问题,指出其包括并引用了 Stack Overflow 的代码;而这些代码是 CC-BY-SA 的,因此与 IPython 的 BSD 许可不兼容。这导致开发团队重写了相应的逻辑,在其案例中以一种更有效的方式完成(搜索的是字符串前缀而不是完整的字符串)。 此外,新版本还还包括了许多文档改进和清理。以及: IPython 指令现在使用 Sphinx logging来处理警告。PR#13030。 为 pastebin magic 添加到期日选项并将 http 协议更改为 https。PR#13056 使 Ipython.utils.timing 与 jupyterlite一起工作。PR #13050 更多详情可查阅发行说明。 下载地址:https://github.com/ipython/ipython/releases/tag/7.26.0

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册