วิธีที่ 2 ภาพต่างๆที่กระพือภาพ

0

คำถาม

ฉันเลยใหม่ที่จะต้องกระพือภาพและฉันต้องทำอะไรซักอย่างเหมือนนี้

this

และสำหรับคนที่สองส่วนหนึ่งของฉันถูกต้องภาพคือที่ทำมาจากทางด้านซ้ายของภาพแล้วมีอีกคนนึกภาพที่สีน้ำเงิน

ไม่ต้องสับสน! ฉันจะอธิบายในวิธีที่ดีกว่า: อย่างแรกฉันต้องบ้าพวกนี้ 2 ภาพต่างๆใน แถว(บางอย่างเหมือน FrameLayout ใน android)

แล้ว ที่ถูกต้องภาพถูกสร้างจากภาพที่เหลือภาพ และ อีกรูปภาพสี(ภาพที่มีเพียง 1 สี)

ฉันหวังว่าคุณได้รับมัน

flutter flutter-layout image
2021-11-23 11:08:44
2

คำตอบที่ดีที่สุด

1

ถ้าคุณมีปัญหาเรื่องเมาท์สองวิดเจ็ต,คุณสามารถใช้ Stack รับมือกับมันได้ในตอนนั้น

2021-11-23 11:16:23

@AmirAndroidDeveloper คุณสามารถใช้ตำแหน่งรักเด็กเป็นลูกของงานและตั้งค่าลำแข้งตัวเองอีกครั้งล่ะ...
M Karimi
1

คุณสามารถใช้เป็น Stack กับ Positioned ต้องทำอย่างนี้: นี่คือตัวอย่างกับไอคอน:

class StackExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(),
      body:  new Container(
        padding: const EdgeInsets.all(8.0),
          height: 500.0,
          width: 500.0,
          // alignment: FractionalOffset.center,
          child: new Stack(
            //alignment:new Alignment(x, y)
            children: <Widget>[
              new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0)),
              new Positioned(
                left: 20.0,
                child: new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0)),
              ),
              new Positioned(
                left:40.0,
                child: new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0)),
              )

            ],
          ),
        ),
      )
    ;
  }
}


class StackExample extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(),
      body:  new Container(
        padding: const EdgeInsets.all(8.0),
          height: 500.0,
          width: 500.0,
          // alignment: FractionalOffset.center,
          child: new Stack(
            //alignment:new Alignment(x, y)
            children: <Widget>[
              new Container(
                decoration: new BoxDecoration(
                  borderRadius: BorderRadius.circular(25.0),
                  boxShadow: [
                    new BoxShadow(
                      blurRadius: 5.0,
                      offset: const Offset(3.0, 0.0),
                      color: Colors.grey,
                    )
                  ]
                ),
                child: new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0))),
              new Positioned(
                left: 20.0,
                child: new Container(
                  decoration: new BoxDecoration(
                  borderRadius: BorderRadius.circular(25.0),
                  boxShadow: [
                    new BoxShadow(
                      blurRadius: 5.0,
                      offset: const Offset(3.0, 0.0),
                      color: Colors.grey,
                    )
                  ]
                ),
                  child: new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0))),
              ),
              new Positioned(
                left:40.0,
                child: new Container(
                  decoration: new BoxDecoration(
                  borderRadius: BorderRadius.circular(25.0),
                  boxShadow: [
                    new BoxShadow(
                      blurRadius: 5.0,
                      offset: const Offset(3.0, 0.0),
                      color: Colors.grey,
                    )
                  ]
                )
                  ,child: new Icon(Icons.notifications, size: 36.0, color: const Color.fromRGBO(218, 165, 32, 1.0))),
              )

            ],
          ),
        ),
      )
    ;
  }
}
2021-11-23 11:28:32

ในภาษาอื่นๆ

หน้านี้อยู่ในภาษาอื่นๆ

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................

ดังอยู่ในนี้หมวดหมู่

ดังคำถามอยู่ในนี้หมวดหมู่