我想创建一个像Android市场第一页的布局.我正在尝试使用gridlayout,因为我想将imageview放入不同的大小和位置,我还需要输入scrollview.
其实我的问题是如何在android.support.v7.widget.GridLayout中输入scrollview?
我试过了:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.astuetz.viewpager.extensions.example"
android:id="@+id/scrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:columnCount="10" >
<ImageView
android:id="@+id/ImageView1"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="1"
android:src="@drawable/tab_background_focused" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_column="5"
app:layout_gravity="bottom"
app:layout_row="1"
android:ems="10" >
<requestFocus />
</EditText>
<ImageView
android:id="@+id/ImageView2"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="1"
app:layout_columnSpan="3"
app:layout_gravity="left"
app:layout_row="2"
android:src="@drawable/tab_background_focused" />
<ImageView
android:id="@+id/ImageView3"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="4"
app:layout_rowSpan="2"
android:src="@drawable/tab_background_focused" android:adjustViewBounds="true"/>
<ImageButton
android:id="@+id/imageButton1"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="7"
android:src="@drawable/background_dots" />
<ImageView
android:id="@+id/imageView4"
android:layout_width="130dp"
android:layout_height="130dp"
app:layout_column="2"
app:layout_gravity="left"
app:layout_row="9" android:adjustViewBounds="true" android:src="@drawable/tab_background"/>
<ImageView
android:id="@+id/imageView5" …
Run Code Online (Sandbox Code Playgroud) 图书馆:
在Sample中PullToRefreshListInViewPagerActivity
仅适用于PageAdapter.
我无法找到一种方法来使用它FragmentPageAdapter
.
样品:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ptr_list_in_vp);
mViewPager = (ViewPager) findViewById(R.id.vp_list);
mViewPager.setAdapter(new ListViewPagerAdapter());
}
private class ListViewPagerAdapter extends PagerAdapter {
@Override
public View instantiateItem(ViewGroup container, int position) {
Context context = container.getContext();
PullToRefreshListView plv = (PullToRefreshListView) LayoutInflater.from(context).inflate(
R.layout.layout_listview_in_viewpager, container, false);
ListAdapter adapter = new ArrayAdapter<String>(context, android.R.layout.simple_list_item_1,
Arrays.asList(STRINGS));
plv.setAdapter(adapter);
plv.setOnRefreshListener(PullToRefreshListInViewPagerActivity.this);
// Now just add ListView to ViewPager and return it
container.addView(plv, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
return plv;
}
@Override
public void destroyItem(ViewGroup …
Run Code Online (Sandbox Code Playgroud) 在iOS 7中,cachePolicy不起作用,它只是缓存下载的json.
//URLRequest
NSString *url = [NSString stringWithFormat:@"http://www.semhora.com/jsonparser/categories/categories_%d_test.json", _categoriesIndex];
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:url]
cachePolicy:NSURLCacheStorageNotAllowed
timeoutInterval:60.0];
Run Code Online (Sandbox Code Playgroud)
如何在iOS 7中禁止缓存?
我希望我的uitextfield在输入结束时像XXX.XXX.XXX/XX.
为了限制长度我使用这个:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if (textField == _cpfField) {
NSUInteger newLength = [textField.text length] + [string length] - range.length;
NSCharacterSet *cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS_ONLY] invertedSet];
NSString *filtered = [[string componentsSeparatedByCharactersInSet:cs] componentsJoinedByString:@""];
return (([string isEqualToString:filtered])&&(newLength <= CHARACTER_LIMIT));
} else{
return YES;
}
}
Run Code Online (Sandbox Code Playgroud)
问题是如何插入"." 和"/",而用户仍在编辑它.
如何使用无服务器框架处理多部分/表单数据?v.0.5.6
刚刚尝试了这个:
"requestTemplates": {
"multipart/form-data": {
"httpMethod": "$context.httpMethod",
"body": "$input.json('$')",
"queryParams": "$input.params().querystring",
"headerParams": "$input.params().header",
"headerParamNames": "$input.params().header.keySet()",
"contentTypeValue": "$input.params().header.get('Content-Type')"
},
"application/json": {
"httpMethod": "$context.httpMethod",
"body": "$input.json('$')",
"queryParams": "$input.params().querystring",
"headerParams": "$input.params().header",
"headerParamNames": "$input.params().header.keySet()",
"contentTypeValue": "$input.params().header.get('Content-Type')"
}
}
Run Code Online (Sandbox Code Playgroud)
action.js:
export function respond(event, cb) {
var form = new formidable.IncomingForm();
form.parse(event, function(err, fields, files) {
if (err == null) {
var response = {
status: "true",
data: fields,
error: []
};
return cb(null, response);
} else {
console.log(err);
return cb(null, ApiErrors.errors(402, err['message'] + fields)); …
Run Code Online (Sandbox Code Playgroud) 这种奇怪的行为发生在我的构建应用程序中.
奇怪的是,这个com.nineoldandroids是一个来自android资源库的jar.
我试图删除构建源并重新编译,没有运气.
我的构建:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "xxxxxxxx"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
// enable crashlytics where you need
buildConfigField "boolean", …
Run Code Online (Sandbox Code Playgroud) 我想根据宽度值计算字体大小.
//Custom Font
Font.loadFont(Fonts.class.getResourceAsStream("/font/bignood/bignoodletoo.ttf"), 10)
String text = "Hello World";
Double width = 100;
Run Code Online (Sandbox Code Playgroud)
编辑:用例
想想一个有文字的按钮"PLAY MONEY"¹
.现在我将文本翻译为PT_BR并立即调用"DINHEIRO FICTICIO"²
.如你所见,单词²大于单词¹,所以如果你设置相同,Font Size
那么你会看到DINHEIRO FIC...
按钮内部.
因此,每当我改变时,这里的任务就是得到它的width
值Button
,得到text
并应用Font Size
以适应全文.Button
text
我正在向Cognito验证链接发送带有HTML标记的消息。
我正在尝试在自定义按钮内发送codeParameter:
<div align="center" class="button-container center" style="padding-right:5px;padding-left:5px;padding-top:15px;padding-bottom:15px">
<a href="{####}" target="_blank" style="display:block;text-decoration:none;-webkit-text-size-adjust:none;text-align:center;color:#323232;background-color:#ffc400;border-radius:25px;-webkit-border-radius:25px;-moz-border-radius:25px;max-width:210px;width:160px;width:auto;border-top:0 solid transparent;border-right:0 solid transparent;border-bottom:0 solid transparent;border-left:0 solid transparent;padding-top:5px;padding-right:25px;padding-bottom:5px;padding-left:25px;font-family:'Droid Serif',Georgia,Times,'Times New Roman',serif;mso-border-alt:none">
<span style="font-size:16px;line-height:32px">Verify your email</span>
</a>
</div>
Run Code Online (Sandbox Code Playgroud)
但是它发送给我:
x-webdoc://9166B278-3889-4E59-A9E2-F88FD6970944/%7B##</a>
Run Code Online (Sandbox Code Playgroud)
而不是像这样的链接:
https://xxxxx.auth.us-east-2.amazoncognito.com/confirmUser?client_id=xxxxxxxxxxxxxxx&user_name=marcuspdg22&confirmation_code=244905
Run Code Online (Sandbox Code Playgroud) android ×3
aws-lambda ×1
build ×1
fonts ×1
grid-layout ×1
html ×1
ios ×1
ios7 ×1
java ×1
javafx ×1
nsurlrequest ×1
objective-c ×1
scrollview ×1
uitextfield ×1