问题标签 [programmatically-created]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - How to put custom style on dynamic created view
I have a problem with styling a dynamic created button in my android app. The way I'm doing it is to create the button from it's constructor:
Button myButton = new Button(this, null, R.style.Frontpage_case);
My problem is that the button layout disappears, but the text is still shown? Is there an other way to accomplish dynamic buttons with different styles?
ios - 带有分页的 UIScrollView + 显示部分上一页/下一页
我正在尝试创建一种类似于“割绳子”游戏用来选择关卡包的“游戏模式”菜单:
我特别想要的是实现显示“当前项目”(在本例中为“2. Fabric Box”项目)加上一些前面和后面的项目的相同效果(以确保用户知道滚动有更多可用模式),启用分页(使滚动视图自动“居中”在这些项目上)。
对于启用了分页的 UIScrollView 来说,这似乎是一项很自然的工作,但是从文档来看,分页似乎发生在多个视图边界上。
所以:如果分页发生在多个视图边界上,有没有办法用 UIScrollView 来实现这种效果?
我们看到整个屏幕宽度的事实表明,在这种情况下 UIScrollView 框架的宽度将是 320px,但每个单独的项目都需要小于该宽度才能显示前一个和下一个项目的那一点点,从而弄乱了分页...
ios - 如何在 xcode 中以编程方式向按钮添加操作
我知道如何通过从界面构建器中拖动来将 IBAction 添加到按钮,但我想以编程方式添加操作以节省时间并避免不断来回切换。解决方案可能非常简单,但是当我搜索它时似乎找不到任何答案。谢谢!
ios - ios/iphone sdk 表单管理最佳实践
我正在开发一个涉及很多表单的 iPhone 应用程序。目前,我为每个设置页面都有一个 ViewController 类,它有一个加载了可能设置的 UITableView。当有人点击一个设置时,他们会被带到一个新的视图来输入表单值,或者允许他们在适当的位置输入内容。
保持干燥的最佳方法是什么?这个实现的哪些部分可以实现一次并重复使用?
当有人单击进入新视图的设置选项时,我如何创建此视图并根据代码中的数据类型(uitextfield 或选择器或其他内容)添加文本字段?
android - 有没有办法以编程方式将滚动视图滚动到特定的编辑文本?
我有一个很长的滚动视图活动。这是一个包含用户必须填写的各种字段的表单。我在表单的中间有一个复选框,当用户检查它时,我想滚动到视图的特定部分。有没有办法以编程方式滚动到 EditText 对象(或任何其他视图对象)?
另外,我知道这可以使用 X 和 Y 坐标,但我想避免这样做,因为表单可能会因用户而异。
ios - 自定义 UIButton(CheckBox) 添加响应者到动作 iOS SDK
我有自定义 UIButton 类:
CheckBox.m 看看 IBAction 我需要在那里实现功能
我需要向此类添加功能,当用户单击我实现 CheckBox 类的类中的按钮时,将调用一些 void。让我更好地解释一下,我想在这里实现功能,例如在 UIAlertView 中单击按钮调用
ios - 如何以编程方式将 UIButton 添加到 UIToolBar?
我已经使用 Interface Builder 添加了工具栏,但我需要在运行时/有条件地添加按钮。我没有收到任何错误,但我的动态按钮没有出现在工具栏上。我已经验证 arrayOfModulesScreens 加载了我需要的数据。至少那有效(:))。我是否需要将按钮添加到 UIView,然后将该视图添加到工具栏?只是大声思考。也许有更好的方法开始?提前感谢您提供解决问题的任何线索。
CustomFormController.h
自定义表单控制器.m
iphone - 如何以编程方式添加文本字段和按钮?
我有一个 tableView,我想在 tableView 上应用搜索工具。为此,我需要 textField 和 search Button 但我不知道如何以编程方式创建这些。所以请告诉我如何创建这两个工具。
谢谢。
iphone - how to add a tab Bar to a Default view and communicate with other views using navigation controller
It might be simple but not able to find exact solution for this.i am using xcode 4.2.
I want to use Tab bar in one of the view in my application. i went through many tutorials all tutorials are related to navigation based application and other view based application.Even i understood how to add a tab bar controller in story board which is main view.
What i need is i have class called Homepage.h and .m and .xib which is subclass of UIViewController class.Again my class is not main class its added later for one of the view.So i want to add a tab bar and communicate with navigationBar and other views so how can i do it plz give me some samples.
Problem is i want to add Tab bar to the default UIView and communicate with navigation controller and other views. i dont want to drag Tab bar controller from utilities.Incase if i drag how can i make it view on moving from one view to another as i already have a Default UIview.Please give me links or any tutorials where i can add tab bar and switch between views using navigation controller.
NOTE: i am using Single View based Application
ios - XCode:以编程方式添加具有特定名称和动画的多个按钮
我刚刚阅读了这篇关于以编程方式添加带有循环的按钮的帖子。
我想做同样的事情,但是为每个人命名,并以相同的方式为它们设置动画。这是个好主意,还是我应该为每个按钮复制同一行代码?
此外,我想从名称列表(大于四个)中添加一些按钮(比如四个)并随机选择它们。问题是,我需要正确命名它们并提取与每个名称关联的图像。有任何想法吗?
感谢社区!