在设计中,我使用Expanded将屏幕分为三部分,但在第二部分中,textfield
当用户尝试输入某些像素溢出设计时,我一直在尝试使用SingleChildScrollView
Expanded与容器小部件一起使用,以消除渲染问题但我的设计消失了。
return Scaffold(
body: Stack(
children: <Widget>[
Container(
decoration: _buildBackground(),
),
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 13,
//child:_toolBar('VENUE LOGIN')
child:MyWidget(headerText: 'Player Option',)
),
Expanded(
flex: 70,
child: Container(
margin: EdgeInsets.only(top: width*0.03),
decoration: BoxDecoration(color: Colors.transparent),child: PlayerOptionContainer(),),
),
Expanded(
flex: 17,
child: _bottomView1(width),
),
],
)
],
),
);
Run Code Online (Sandbox Code Playgroud)
PlayerOptionWidget方法
Widget PlayerOptionContainer(){
return Column(
children: <Widget>[
Expanded(flex:25,
child: Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Expanded(flex: 30,child: _logoContainer(width),),
Expanded(flex: 70,child: searchContainer(),),
],),), …
Run Code Online (Sandbox Code Playgroud) 但两者都给出了解决方案,例如更改海拔或平移。
问题是关于在不支持海拔或平移属性的旧版本中将进度栏放在按钮前面。
我怎样才能在 XML 和 Java 中做到这一点?
或者它是无效的。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.business.abdelhafiz.omar.civiltaif.LoginActivity">
<ImageView
android:src="@drawable/home_civil"
android:scaleType="fitXY"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<ProgressBar
android:id="@+id/login_progressbar"
android:layout_centerInParent="true"
android:layout_width="@dimen/image_height"
android:layout_height="@dimen/image_height" />
<Button
android:id="@+id/login_email"
android:layout_centerInParent="true"
android:text="@string/login_email"
android:onClick="loginEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button
android:id="@+id/login_anonymous"
android:layout_centerInParent="true"
android:layout_below="@id/login_email"
android:text="@string/login_anonymous"
android:onClick="loginAnonymous"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这是一个屏幕截图
我想将进度条放在按钮前面
编辑:
没有什么对我有用,所以当我需要显示进度栏时,我只会隐藏按钮。
感谢您的帮助。
我在一个对象中传递多个参数,然后将其传递给控制器中的方法。它正在调用该方法,但它没有携带从 ajax 调用发送到该方法的数据。当我要检查模型的对象时,它显示为空。那么我可以以这种方式发送数据还是应该尝试其他方法?预先感谢请帮助我。这是我的代码。
var Color = [], Material = [], Size = [], FinishingType = [], Style = [];
$('.productFilterLabelList .filterList').on('change', '[type=checkbox]', function () {
debugger;
var Main = {};
var filterType = $(this).parents('.productFilterLabelList').find('.hdn-filter-type').val();
var filterTypeID = $(this).val();
var ischeked = $(this).is(':checked');
if (ischeked) {
if (filterType == 'color') {
Color.push(filterTypeID);
}
else if (filterType == 'size') {
Size.push(filterTypeID);
}
else if (filterType == 'finsih') {
FinishingType.push(filterTypeID);
}
else if (filterType == 'material') {
Material.push(filterTypeID)
}
else {
Style.push(filterTypeID);
} …
Run Code Online (Sandbox Code Playgroud)grid-layout android-layout android-3.1-honeycomb android-studio
它可以在Java中轻松完成.
for(Event event:eventList){
if(event.id.equalTo(eventId){
Event e=new Event();
e=event;
}
}
Run Code Online (Sandbox Code Playgroud)
我在Kotlin这样做,但预计结果不会到来
fun filterList(listCutom: List<Event>?) {
listCutom!!.forEachIndexed { index, eventid ->
if (listCutom[index].eventTypeId.equals(eventType)) {
event= eventid
}
}
}
Run Code Online (Sandbox Code Playgroud)
我该怎么做科特林使用filter
或forEachIndexed
或有效另一种方式?
在flutter应用程序中集成Firebase消息服务并在flutter中使用最新的firebase_messaging:^3.0.0
gradle但是在安装应用程序时显示错误并且我已经多次重新安装该应用程序。
FlutterFirebaseInstanceIDService.java:21: error: cannot find symbol
LocalBroadcastManager.getInstance(context).sendBroadcast(intent);
FlutterFirebaseInstanceIDService.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Run Code Online (Sandbox Code Playgroud)
我build.gradle
在 android 部分添加了这些行,仍然显示相同的错误。我已经采取了参考。从这里。
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xlint:deprecation"
}
}
Run Code Online (Sandbox Code Playgroud)
如何解决-Xlint:deprecation
颤振的此错误。
如果存在,我想在填充服务器数据之前删除表。
我正在尝试的查询
deleteOptionTable() async {
final db = await database;
db.rawDelete("Delete * from option");
}
dropTable() async {
final db = await database;
db.query('SELECT * FROM cloudnet360.db WHERE name =option and type=table');
}
Run Code Online (Sandbox Code Playgroud)
我试过这样的事情,但没有发生任何事情。
void _insertOption(OptionsGroupList option) async {
int idd = dbHelper.dropTable();
print('DROP TABLE: $idd');
PreferencesConnector myprefs= PreferencesConnector();
String merchantid=await myprefs.readString('merchantid');
String hashkey=await myprefs.readString('hashkey');
Map<String, dynamic> row = {
DatabaseHelper.columnGroupId:option.grouprowid ,
DatabaseHelper.columnGroupName: option.groupname,
DatabaseHelper.columnIsRequired:option.isrequired ,
DatabaseHelper.columnMerchantId: merchantid,
DatabaseHelper.columnMerchantHashKey: hashkey,
};
int id = await dbHelper.insertOption(row);
print('inserted option row id: …
Run Code Online (Sandbox Code Playgroud) 当选择特定选项的属性时,我有一个选项列表,然后将属性对象保存在列表中选项的所选位置。现在我有一个带有其选定属性对象的选项列表。我的目的是将选项列表转换为JSON对象,但是当属性不为null时。在这种情况下,如果人们没有选择选项的属性,则Attribute对象可以为null。
class OptionAttribute{
String _grouprowid;
String _groupname;
Attribute _selectedAttrObject
Map<String, dynamic> toJson() => {
'attribute': _selectedAttrObject,
};
}
class Attribute{
String _attributerowid;
String _grouprowid;
String _attributename;
String _weight;
Map<String, dynamic> toJsonAttr() => {
'attrid': _attributerowid,
'groupid': _grouprowid,
'attrname': _attributename
};
}
Run Code Online (Sandbox Code Playgroud)
当列表没有任何null属性时,我想将以下列表转换为JSON对象。
List<OptionAttribute> opAtrrList=new List<OptionAttribute>();
Run Code Online (Sandbox Code Playgroud) JSON
包含撇号的响应字符串
这是来自服务器的键和值。
"name": "men’s basketball wear with free product",
Run Code Online (Sandbox Code Playgroud)
当我将其转换JSON
为 pojo response
Future<Product>
在日志中打印字符串时返回给我。
产品名称
menâs basketball wear with free product
我已经尝试过这个解决方案, 但什么也没发生
replaceAll("'", "\'").replaceAll('"', "\'")
replaceAll('"', '\\"')
Run Code Online (Sandbox Code Playgroud)
我在响应课上试过
Product.fromJsonMap(Map<String, dynamic> map):
pid = map["pid"],
aid = map["aid"],
name = map["name"].replaceAll("'", "\'");
Run Code Online (Sandbox Code Playgroud)
我的 HTTP 请求
http.Response res = await http.get(url);
Run Code Online (Sandbox Code Playgroud) 我有包含三个片段的 minidemo。一个显示两个TextView
和一个editview
直接,下一个使用自定义适配器将相同的布局视为列表中的行,第三个显示一个带有标准适配器的普通列表(simple_list_item_1)
活动使用标准主题(Theme.AppCompat.Light.DarkActionBar
),我没有修改。
我本来希望所有三个块的样式都相似。相反,带有自定义适配器的第二个块似乎根本没有根据浅色主题进行样式设置。(见文末截图)
理想情况下,我希望自定义列表的行的样式类似于第一个块。或者,我想应用第三个块的样式。但是,所有字体和背景似乎都有些偏色,我不确定如何找出当前用作主题一部分的内容。因此,通过手动分配文本颜色、大小、背景等来修复中间块的样式不是一种选择。
整个演示请参考MiniDemo
这是 item_row.xml 布局文件(顶层相对布局标签好像被编辑器剥离了。完整布局请到gitlab)
<TextView android:text="large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:textAppearanceLarge"
android:id="@+id/text1_field" />
<TextView android:text="large inverse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/text2_field"
android:textAppearance="?android:attr/textAppearanceLargeInverse"
android:layout_centerHorizontal="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="number"
android:ems="5"
android:id="@+id/edit_field"
android:layout_alignParentRight="true" />
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
自定义片段。同样,完整版在gitlab 上
public class CustomItemFragment extends ListFragment {
String[] DATA = new String[] {"foo1", "foo2", "foo3"};
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ItemAdapter adapter = new ItemAdapter(this.getActivity().getApplicationContext(), DATA);
setListAdapter(adapter);
}
Run Code Online (Sandbox Code Playgroud)
}`
适配器(gitlab):
public class …
Run Code Online (Sandbox Code Playgroud) android listview android-appcompat android-arrayadapter android-theme