hackers-painters / samurai-native Goto Github PK
View Code? Open in Web Editor NEWBring web standards to native platform
Home Page: http://hackers-painters.github.io/samurai-native/
License: MIT License
Bring web standards to native platform
Home Page: http://hackers-painters.github.io/samurai-native/
License: MIT License
文字颜色一直为白色,使用css并不能够更改,从catalog uibutton的运行结果可以看出.
原因是UIButton+Html.m当中处理button颜色的时候,使用了titleLabel.textColor,但是ios的document明确指出
Do not use the label object to set the text color or the shadow color. Instead, use the setTitleColor:forState: and setTitleShadowColor:forState: methods of this class to make those changes.
因此要改成[self setTitleColor:[style computeColor:self.titleLabel.textColor] forState:UIControlStateNormal];
就正确了。
Hey, guys
How about the progress of the android paln?
rt
小程序估计就是是借鉴了这个方案弄的,在这个基础上完全可以做个类似小程序差不多的壳架子
html部分代码是这样的
<UICollectionView name="sections" id="list" class="list" columns="1" is-vertical>
<UICollectionViewCell name="section" class="cell" is-row>
<div class="title">
<div class="title-name" name="name">Name</div>
<div class="title-time" name="time">time</div>
</div>
</UICollectionViewCell>
</UICollectionView>
<style>
.list {
display: block;
width: 100%;
height: 100%;
z-index: 1;
background-color: #eaeaea;
margin-top: 2px;
}
.cell {
height: 80px;
color: #333;
background-color: #eee;
border-bottom: 1px;
border-bottom-color: #ccc;
border-bottom-style: solid;
}
.title {
width: 100%;
height: 100%;
float: right;
}
.title-name {
padding-top: 15px;
padding-left: 30px;
color: #333;
font-size: 16px;
}
.title-time {
padding-left: 30px;
color: #aaa;
font-size: 13px;
}
</style>
对list使用ATTR后
$(@"#list").ATTR(@"display",@"none");
$(@"#list").ATTR(@"display",@"block");
再让list显示后,list里面文字部分的字号和字体颜色都会发生变化,字体会变为一样大,颜色黑色。
字体设置font-family无效。
实机上运行需要注释掉。
//DEBUG_RENDERER_DOM( self );
iOS7系统下 UICollectionViewCell 不显示。
集成阿里百川的SDK,在初始化阿里百川SDK的时候总是导致crash,去掉Samurai就可以正常初始化。
.hidden2
{
display: none;
background-color: #aaa;
}
直接在html用正常.如果用下面的方法在oc里添加进去,
$(@"#scan").ADD_CLASS( @"hidden2" );
[self.scan addCssStyleClass:@"hidden2"];
display: none无效
background-color: #aaa; 有效
如题,加载起始页正常,再切到下一页的话,就会变白,然后再返回前一页,前一页也变白了
用dribbble那个demo测试的
NSString * path = [NSString stringWithFormat:@"http://www.other.com/swift/samurai-native-master/samurai-examples/dribbble/demo/www/html/%@/%@", theme, name];
I try to modify the tabbar content in dribbble demo, but it's not work.
<div name="tabbar" class="tab-bar">
<div id="tab1" name="popular" class="tab" onclick="signal('switch-tab1')">Popular</div>
<div id="tab2" name="debuts" class="tab" onclick="signal('switch-tab2')">Debuts</div>
<div id="tab3" name="everyone" class="tab" onclick="signal('switch-tab3')">Everyonesss</div>
</div>
Then i found the tabbar is defined in obj-c, so could we move tabbar code to html that build the demo with full web stack?
- (void)reloadData
{
self[@"tabbar"] = @{
@"popular" : ({
NSString * text = nil;
if ( _currentModel == self.model1 )
{
text = @"/Popular/";
}
else
{
text = @"Popular";
}
text;
}),
@"debuts" : ({
NSString * text = nil;
if ( _currentModel == self.model2 )
{
text = @"/Debuts/";
}
else
{
text = @"Debuts";
}
text;
}),
@"everyone" : ({
NSString * text = nil;
if ( _currentModel == self.model3 )
{
text = @"/Everyone/";
}
else
{
text = @"Everyone";
}
text;
}),
};
self[@"list"] = @{
@"shots" : ({
NSMutableArray * shots = [NSMutableArray array];
for ( SHOT * shot in _currentModel.shots )
{
[shots addObject:@{
@"shot-url" : shot.images.teaser ?: @"",
@"author-avatar" : shot.user.avatar_url ?: @"",
}];
}
shots;
})
};
}
UITableViewCell的border-bottom-width设置为0.5px时,item很多时(出现滚动条),来回滚动几次,一些cell的border-bottom就不见了
IOS兼容swift吗?
已继承SamuraiActivity的ViewController, 默认隐藏了status bar. 覆盖实现prefersStatusBarHidden也无法显示status bar.
...
示例:
$(dom).ATTR(@"display", @"none");
错误行数:
Samurai_HtmlRenderQuery.m第350行:
SamuraiHtmlRenderQueryBlockN block = (SamuraiHtmlRenderQueryBlockN)^ SamuraiHtmlRenderQuery * ( NSString * key, NSString * value )
错误原因:
可变参数导致的闪退问题。只有在iPhone5S以上(64位设备)真机Release环境下会发生闪退。
只要ATTR传了第二个参数,就会闪退。传一个参数不会。
无意中发现了,请测试并官方修复,谢谢啦。
新人,直接学的swift,用了桥接把samurai-native引进来了,用swift重写catalog的,其他都好,就是Test_UITextField里报Use of unresolved identifier '$',求大神给个解决方法
"This sentence should be purple."
but it shows gray.
replace all assert() with if ( false ) return
in katana parser.
很想问一个开发者都比较关注的问题,不知道对Android版的发布大约要多久以后呢?否则我相信不少朋友依旧处于观望状态。谢谢。
!important 需要支持一下
从view-component来看,似乎类型并不可以指定,而只能够使用custom。
UIButton * button = [self buttonWithType:UIButtonTypeCustom];
button.renderer = renderer;
[[button buttonAgent] enableEvents];
return button;
但是如果用户想使用systemtype,则没有办法。
如果确实是没有办法的话,是不是考虑指定一个参数,使得用户可以创建systemtype的uibutton.
在Bee里面有POST的例子,这里找不到POST的例子。我往代码去看,貌似要自己去写一个Client然后继承STIHTTPSessionManager,去加POST的方法。是这样子吗?还是有更好的办法。
我看到AFN底层是有预留的
multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:
目前readme还是非常简单, 是否可以提供进一步的API文档。
如果有一个demo app支持来呈现所有组件和能力最好了。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.