我正在开发一个应用程序,其中将横幅广告放在屏幕上,我想将该横幅广告移动到左侧或右侧,我能够垂直移动但不能水平移动。
答案 0 :(得分:-1)
尝试以下代码段:
Widget getBannerContainer(){
var offerBannerHeight = 93.0;
var offerBannerWidth = screenWidth;
var list = PageView.builder(
controller: controller,
itemCount: 10,
scrollDirection: Axis.horizontal,
itemBuilder: (BuildContext context, int position) {
final bannerDetail = this.widget.bannerList[position];
final bannerImage = FadeInImage.assetNetwork(placeholder: placeholderImage, image: Bannerimg, fit: BoxFit.cover, width: offerBannerWidth,
height: offerBannerHeight,);
final bannerImageInkWell = InkWell(child: bannerImage, onTap: () {},);
return bannerImageInkWell;
});
this.startTimer();
return Container(child: list, height: offerBannerHeight,);
}
希望这会有所帮助!