传奇ui dui state dialogtabsheet1怎么编辑

【手机软件资讯地图】 - 58同城在 SegmentFault,解决技术问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
一线的工程师、著名开源项目的作者们,都在这里:
获取验证码
已有账号?
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
效果类似与 easyui 或者 b-jui 的多tab窗口功能。如:
我想到主要有两个技术难点:1、每个tab窗口对应一个Controller。2、每个tab窗口对应一个ui-router的state。
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
每个tab窗口对应一个ui-router的state
&ul class="nav nav-sub dk"&
&a ui-sref="app.tab1" href class="nav-item"&
&span&tab1&/span&
&a ui-sref="app.tab2" href class="nav-item"&
&span&tab2&/span&
&a ui-sref="app.tab3" href class="nav-item"&
&span&tab3&/span&
.state('app.tab1', {
url: '/tab1',
templateUrl: 'src/tpl/tab1.html'
}).state('app.tab2', {
url: '/tab2',
templateUrl: 'src/tpl/tab2.html'
}).state('app.tab3', {
url: '/tab3',
templateUrl: 'src/tpl/tab3.html'
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
用angular2 我有解决方案,利用动态加载的方法来加载页面,每次点击菜单的时候加载并实例化该菜单绑定的页面类.然后把实例化的页面加入到一个数组中然后用 *ngfor 的形式展示出来,每个页面的操作不影响其他页面,关闭或者打开的页面的时候也只需要操作页面数组
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
楼主这个问题解决了吗, 能分享下吗
该答案已被忽略,原因:
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
楼主解决了吗?
该答案已被忽略,原因:
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:在 SegmentFault,解决技术问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
一线的工程师、著名开源项目的作者们,都在这里:
获取验证码
已有账号?
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
&div class="nav"&
&div class="nav_container"&
&span ng-repeat="nav in navs" ui-sref-active="li_selected" ui-sref=".{{nav.url}}"&
{{nav.name}}
&em ng-click="CloseNav(nav.value)"&&/em&
&div class="content clearFix" &
&div ui-view="" ng-style="high" style="overflow:"&&/div&
如图所示,点击不同的标签,ui-view区域显示不同的页面。但是在切换页面的同时,会重新刷新页面,我在页面上的操作都会被刷新掉。我想实现大概如:
&div ui-view="html1" ng-show="html1"&&/div&
&div ui-view="html2" ng-show="html2"&&/div&
&div ui-view="html3" ng-show="html3"&&/div&
&div ui-view="html4" ng-show="html4"&&/div&
通过不同的标签页来控制不同ui-view的显示,或隐藏,同时保留用户的操作,不用刷新页面。刚学习angularjs,对ui-view使用不熟练,求大神解答我这思路是不是正确的,能实现的话给出详细的代码;不正确的话,有什么别的办法吗,也请给出详细的代码,谢谢了!!
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
设置一个ui-view就够了,只需要对不同的state加载不同的temlpate
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
你这个和ui-router无关,普通的页面切换本身就不能保存input里面输入的东西你可以:
页面输入的数据,当切换tab时持久化到后端,即切换先保存
或者保存到service中
或者保存到localstorage中总之找个地方存起来,再切换回来的时候再拿到
另可参考:
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
首先,切换tab不需要刷新页面,可以用angular.factory创建一个缓存,数据修改后进行缓存。如果没有用router,想用ng-show控制4个view的显示,可以把ui-view换成include
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
每个tab对应一个ui-view,每个页面显示在不同的view里面就可以了
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
angular.factory创建一个缓存,数据修改后进行缓存,@prototype
使用缓存,这思路不错,我学习了
该答案已被忽略,原因:
同步到新浪微博
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:Android之UI学习篇十:使用TabHost实现微博客户端界面 - CSDN博客
Android之UI学习篇十:使用TabHost实现微博客户端界面
这里模拟微博客户端进行案例开发,由于没有图片资源,所以就做了一个大体结构类似的案例,跟大家分享一下它的实现,这里采用的是使用xml布局结合TabActivity控制。
先看看实现的效果:
工程目录结构:
以下是源代码:
MainActivity.java
package com.tablehost.
import android.app.A
import android.app.TabA
import android.content.I
import android.os.B
import android.speech.SpeechR
import android.widget.RadioB
import android.widget.RadioG
import android.widget.RadioGroup.OnCheckedChangeL
import android.widget.TabH
import android.widget.TabHost.TabS
public class MainActivity extends TabActivity implements OnCheckedChangeListener{
private TabHost tabH
private RadioGroup radioG
private RadioButton radioButton1;
private RadioButton radioButton2;
private RadioButton radioButton3;
private RadioButton radioButton4;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//获取TabHost组件
tabHost = getTabHost();
//新建一个标签页
TabSpec tabSpec1 = (TabSpec)tabHost.newTabSpec(&HOME&).setIndicator(&HOME&);
//给标签页设置内容
tabSpec1.setContent(new Intent(MainActivity.this,HomeActivity.class));
//把标签页添加到TabHost当中去
tabHost.addTab(tabSpec1);
TabSpec tabSpec2 = (TabSpec)tabHost.newTabSpec(&COMMENT&).setIndicator(&COMMENT&);
tabSpec2.setContent(new Intent(MainActivity.this,CommentActivity.class));
tabHost.addTab(tabSpec2);
TabSpec tabSpec3 = (TabSpec)tabHost.newTabSpec(&SAVE&).setIndicator(&SAVE&);
tabSpec3.setContent(new Intent(MainActivity.this,SaveActivity.class));
tabHost.addTab(tabSpec3);
TabSpec tabSpec4 = (TabSpec)tabHost.newTabSpec(&MORE&).setIndicator(&MORE&);
tabSpec4.setContent(new Intent(MainActivity.this,MoreActivity.class));
tabHost.addTab(tabSpec4);
setUpView();
//关联RadioButton 和 TabHost
radioGroup.setOnCheckedChangeListener(this);
//我的一贯作风
public void setUpView(){
radioGroup = (RadioGroup)findViewById(R.id.group);
radioButton1 = (RadioButton)findViewById(R.id.radioButton1);
radioButton2 = (RadioButton)findViewById(R.id.radioButton2);
radioButton3 = (RadioButton)findViewById(R.id.radioButton3);
radioButton4 = (RadioButton)findViewById(R.id.radioButton4);
public void onCheckedChanged(RadioGroup group, int checkedId) {
switch (checkedId) {
case R.id.radioButton1:
tabHost.setCurrentTabByTag(&HOME&);
case R.id.radioButton2:
tabHost.setCurrentTabByTag(&COMMENT&);
case R.id.radioButton3:
tabHost.setCurrentTabByTag(&SAVE&);
case R.id.radioButton4:
tabHost.setCurrentTabByTag(&MORE&);
CommentActivity.java:
package com.tablehost.
import android.app.A
import android.os.B
public class CommentActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(ment);
其他几个Activity类似
在工程的src 目录下新建了一个目录: drawable ,里面新建一个button.xml,用来定义radioButton的选中等不同状态时,显示不同的背景图片:
button.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&selector xmlns:android=&/apk/res/android&&
&!-- 当单选框可用,且获得焦点还没有按下显示的背景 --&
&item android:state_enabled=&true& android:state_focused=&true&
android:state_pressed=&false& android:drawable=&@drawable/home_btn_bg_s&&
&!-- 当单选框可用,且被按下时显示的背景 --&
&item android:state_enabled=&true& android:state_pressed=&true&
android:drawable=&@drawable/home_btn_bg_s&&
&!-- 当单选框可用,且被选中了时的背景 --&
&item android:state_enabled=&true& android:state_checked=&true&
android:drawable=&@drawable/home_btn_bg_d&&
&/selector&
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:orientation=&vertical& &
&!-- TabHost的id写固定值,在Activity通过getTabHost()方法才能取得到 --&
android:id=&@android:id/tabhost&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&&
&!-- 放置frame视图和标签页 --&
&LinearLayout
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:orientation=&vertical&&
&FrameLayout
android:id=&@android:id/tabcontent&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:layout_weight=&1.0&&
&/FrameLayout&
&TabWidget
android:id=&@android:id/tabs&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:visibility=&gone&&
&/TabWidget&
&RadioGroup
android:id=&@+id/group&
android:layout_width=&fill_parent&
android:layout_height=&50dp&
android:background=&@drawable/tab_bg&
android:gravity=&center_vertical&
android:orientation=&horizontal&&
&RadioButton
android:id=&@+id/radioButton1&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:button=&@null&
android:text=&@string/home&
android:drawableTop=&@drawable/icon_1_n&
android:gravity=&center_horizontal&
android:background=&@drawable/button&
android:layout_weight=&1&
android:checked=&true&/&
&RadioButton
android:id=&@+id/radioButton2&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:button=&@null&
android:text=&@string/comment&
android:drawableTop=&@drawable/icon_2_n&
android:gravity=&center_horizontal&
android:background=&@drawable/button&
android:layout_weight=&1&/&
&RadioButton
android:id=&@+id/radioButton3&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:button=&@null&
android:text=&@string/save&
android:drawableTop=&@drawable/icon_3_n&
android:gravity=&center_horizontal&
android:background=&@drawable/button&
android:layout_weight=&1&/&
&RadioButton
android:id=&@+id/radioButton4&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:button=&@null&
android:text=&@string/more&
android:drawableTop=&@drawable/icon_4_n&
android:gravity=&center_horizontal&
android:background=&@drawable/button&
android:layout_weight=&1&/&
&/RadioGroup&
&/LinearLayout&
&/TabHost&
&/LinearLayout&
comment.xml:
&?xml version=&1.0& encoding=&utf-8&?&
&LinearLayout xmlns:android=&/apk/res/android&
android:layout_width=&fill_parent&
android:layout_height=&fill_parent&
android:orientation=&vertical&
android:background=&@drawable/b&&
android:layout_width=&fill_parent&
android:layout_height=&wrap_content&
android:text=&Hello world! CommentActivty& /&
&/LinearLayout&
其他几个布局文件相似。
本文已收录于以下专栏:
相关文章推荐
ActivityGroup在实际的开发中是十分常见的,在我使用过的Android应用中,十个应用里面有九个应用的主界面都是使用ActivityGroup的。说起ActivityGroup,在国内好像直...
ActivityGroup在实际的开发中是十分常见的,在我使用过的Android应用中,十个应用里面有九个应用的主界面都是使用ActivityGroup的。说起ActivityGroup,在国内好像直...
在前篇完成了用户登录功能后开始用户首页的开发,用户的首页主要的内容是当前登录用户关注的微博列表,本篇先来讲讲UI的实现,效果如上图,整个页面分为上、中、下三部分,上面部分是工具条,显示当前登录用户的昵...
本软件设定用户第一个接触到的功能就是页面载入等待功能,这个功能对使用者来说就是一个持续1、2秒钟的等待页面,在用户等待的同时程序做一些必要的检查以及数据准备工作,载入页面分为UI篇和功能篇,从表及里首...
在前篇完成了用户登录功能后开始用户首页的开发,用户的首页主要的内容是当前登录用户关注的微博列表,本篇先来讲讲UI的实现,效果如上图,整个页面分为上、中、下三部分,上面部分是工具条,显示当前登录用户的昵...
本文转自:/hll2008/archive//1924952.html
 本软件设定用户第一个接触到的功能就是页面载入等待功能...
本软件设定用户第一个接触到的功能就是页面载入等待功能,这个功能对使用者来说就是一个持续1、2秒钟的等待页面,在用户等待的同时程序做一些必要的检查以及数据准备工作,载入页面分为UI篇和功能篇,从表及里首...
首先回顾一下功能流程当用户开启软件显示载入页面时程序首先去sqlite库查询是否已经保存有用户的新浪微博的UserID号、Access Token、Access Secret的记录如果没有一条记录那么...
在前篇完成了用户登录功能后开始用户首页的开发,用户的首页主要的内容是当前登录用户关注的微博列表,本篇先来讲讲UI的实现,效果如上图,整个页面分为上、中、下三部分,上面部分是工具条,显示当前登录用户的昵...
转自: http://blog.csdn.net/sunmanzth/article/details/6902458
首先,设置要覆盖在最上方的dialog的view
他的最新文章
讲师:何宇健
讲师:董岩
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)

我要回帖

更多关于 ui router state 参数 的文章

 

随机推荐