小编She*_*sky的帖子

颤振:垂直中心列

如何在Flutter中垂直居中列?我使用了widget"new Center".我使用过小部件"新中心",但它没有垂直居中我的列?任何想法都会有所帮助....

@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text("Thank you"),
    ),
    body: new Center(
      child: new Column(
        children: <Widget>[
          new Padding(
            padding: new EdgeInsets.all(25.0),
            child: new AnimatedBuilder(
              animation: animationController,
              child: new Container(
                height: 175.0,
                width: 175.0,
                child: new Image.asset('assets/angry_face.png'),
              ),
              builder: (BuildContext context, Widget _widget) {
                return new Transform.rotate(
                  angle: animationController.value * 6.3,
                  child: _widget,
                );
              },
            ),
          ),
          new Text('We are glad we could serve you...', style: new TextStyle(
              fontSize: 16.0,
              fontWeight: FontWeight.w600,
              color: Colors.black87),), …
Run Code Online (Sandbox Code Playgroud)

flutter

40
推荐指数
9
解决办法
3万
查看次数

C ++:附加到向量字符串

我正在编写一个“猪拉丁”程序;读取用户的输入(名字和姓氏),使输入变为小写并根据名称中的内容更改名称。如果第一个字母(名字和姓氏)都是元音,我们应该在其末尾添加“ way”。

如果第一个字母是辅音,我们将把第一个字母移到字符串的末尾,并在其末尾添加“ ay”。

尝试在字符串末尾添加文本时,我的代码给我错误。它说不能将字符串转换为字符,我不确定这意味着什么。它还说我不能将输出操作数<<用于字符串,即使我以前使用过它也是如此。

错误出现在“ strcpy”和我输出名称的最终代码中。

37:错误:无法转换'std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >''char*'的参数'1''char* strcpy(char*, const char*)'

47:错误:无法转换'std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >''char*'的参数'1''char* strcpy(char*, const char*)'

54:错误:不对应的'operator<<''std::cout << first'

我只需要一些帮助来修复错误并查看我哪里出错了。包括完整的代码。

#include <iostream>
#include <vector>
#include <cstring>
#include <string>
using namespace std;
int main()
{
    int q, s;
    char shea[] = "way";
    char gavin_stop_looking_at_ponies[] = "ay";
    vector …
Run Code Online (Sandbox Code Playgroud)

c++ string vector append strcpy

0
推荐指数
1
解决办法
3344
查看次数

标签 统计

append ×1

c++ ×1

flutter ×1

strcpy ×1

string ×1

vector ×1